examples/resources: Unify jab.wav to 48000 Hz

Updates #1649
This commit is contained in:
Hajime Hoshi 2021-05-25 22:32:46 +09:00
parent ac526b1b83
commit 95a98950b8
7 changed files with 5 additions and 11 deletions

View File

@ -141,7 +141,7 @@ func init() {
log.Fatal(err) log.Fatal(err)
} }
jabD, err := wav.Decode(audioContext, bytes.NewReader(raudio.Jab48000_wav)) jabD, err := wav.Decode(audioContext, bytes.NewReader(raudio.Jab_wav))
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
//go:generate file2byteslice -package=audio -input=./audio/jab.wav -output=./audio/jab.go -var=Jab_wav //go:generate file2byteslice -package=audio -input=./audio/jab.wav -output=./audio/jab.go -var=Jab_wav
//go:generate file2byteslice -package=audio -input=./audio/jab48000.wav -output=./audio/jab48000.go -var=Jab48000_wav
//go:generate file2byteslice -package=audio -input=./audio/jump.ogg -output=./audio/jump.go -var=Jump_ogg //go:generate file2byteslice -package=audio -input=./audio/jump.ogg -output=./audio/jump.go -var=Jump_ogg
//go:generate file2byteslice -package=audio -input=./audio/ragtime.mp3 -output=./audio/ragtime.mp3.go -var=Ragtime_mp3 //go:generate file2byteslice -package=audio -input=./audio/ragtime.mp3 -output=./audio/ragtime.mp3.go -var=Ragtime_mp3
//go:generate file2byteslice -package=audio -input=./audio/ragtime.ogg -output=./audio/ragtime.ogg.go -var=Ragtime_ogg //go:generate file2byteslice -package=audio -input=./audio/ragtime.ogg -output=./audio/ragtime.ogg.go -var=Ragtime_ogg

View File

@ -46,13 +46,13 @@ func init() {
// Initialize audio context. // Initialize audio context.
g.audioContext = audio.NewContext(sampleRate) g.audioContext = audio.NewContext(sampleRate)
// In this example, embedded resource "Jab48000_wav" is used. // In this example, embedded resource "Jab_wav" is used.
// //
// If you want to use a wav file, open this and pass the file stream to wav.Decode. // 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 // Note that file's Close() should not be closed here
// since audio.Player manages stream state. // since audio.Player manages stream state.
// //
// f, err := os.Open("jab48000.wav") // f, err := os.Open("jab.wav")
// if err != nil { // if err != nil {
// return err // return err
// } // }
@ -61,7 +61,7 @@ func init() {
// ... // ...
// Decode wav-formatted data and retrieve decoded PCM stream. // Decode wav-formatted data and retrieve decoded PCM stream.
d, err := wav.Decode(g.audioContext, bytes.NewReader(raudio.Jab48000_wav)) d, err := wav.Decode(g.audioContext, bytes.NewReader(raudio.Jab_wav))
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }