pixijs / sound

WebAudio API playback library, with filters. Modern audio playback for modern browsers.
https://pixijs.io/sound/examples/
MIT License
409 stars 67 forks source link

undefined is not an object (evaluating 'this.find(t).play') #242

Open meghe2000 opened 1 year ago

meghe2000 commented 1 year ago
const AudioContext = window.AudioContext || window.webkitAudioContext
const audioCtx = new AudioContext()

function addAudio(name) {
    fetch(loader(name)).then(response => response.arrayBuffer()).then(buffer => audioCtx.decodeAudioData(buffer)).then(buffer => {
        sound.add({ [name[0]]: buffer, }, { preload: true })
    })
}
for (const n of ['1.mp3', '3.ogg', '4.mp3', '5.mp3']) addAudio(n)

//after run this function get error sound.play('3')

The error is received only on Safari Mobile.

meghe2000 commented 1 year ago

3.ogg.zip The rest of the sounds are played well. But this sound gives an error on safari.