examples/flappy: use DecodeWithSampleRate instead of Decode

This commit is contained in:
Hajime Hoshi 2022-04-10 14:55:48 +09:00
parent 9b7328442b
commit 648c8ed1f9

View File

@ -179,7 +179,7 @@ func (g *Game) init() {
g.audioContext = audio.NewContext(48000) g.audioContext = audio.NewContext(48000)
} }
jumpD, err := vorbis.Decode(g.audioContext, bytes.NewReader(raudio.Jump_ogg)) jumpD, err := vorbis.DecodeWithSampleRate(48000, bytes.NewReader(raudio.Jump_ogg))
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@ -188,7 +188,7 @@ func (g *Game) init() {
log.Fatal(err) log.Fatal(err)
} }
jabD, err := wav.Decode(g.audioContext, bytes.NewReader(raudio.Jab_wav)) jabD, err := wav.DecodeWithSampleRate(48000, bytes.NewReader(raudio.Jab_wav))
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }