mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
parent
c0e12450df
commit
ac526b1b83
@ -31,7 +31,7 @@ import (
|
||||
const (
|
||||
screenWidth = 640
|
||||
screenHeight = 480
|
||||
sampleRate = 44100
|
||||
sampleRate = 48000
|
||||
)
|
||||
|
||||
type Game struct {
|
||||
@ -46,13 +46,13 @@ func init() {
|
||||
// Initialize audio context.
|
||||
g.audioContext = audio.NewContext(sampleRate)
|
||||
|
||||
// In this example, embedded resource "Jab_wav" is used.
|
||||
// In this example, embedded resource "Jab48000_wav" is used.
|
||||
//
|
||||
// If you want to use a wav file, open this and pass the file stream to wav.Decode.
|
||||
// Note that file's Close() should not be closed here
|
||||
// since audio.Player manages stream state.
|
||||
//
|
||||
// f, err := os.Open("jab.wav")
|
||||
// f, err := os.Open("jab48000.wav")
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
@ -61,7 +61,7 @@ func init() {
|
||||
// ...
|
||||
|
||||
// Decode wav-formatted data and retrieve decoded PCM stream.
|
||||
d, err := wav.Decode(g.audioContext, bytes.NewReader(raudio.Jab_wav))
|
||||
d, err := wav.Decode(g.audioContext, bytes.NewReader(raudio.Jab48000_wav))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user