Audio Sound not playing in the Firebox using AudioContext

215 views Asked by At

using the WebAudio API AudioContext. its working fine in the chrome and playing sounds. but its not playing sound in the firefox, showing icon in the bar of playing audio.

// console.log("this.audioContext.state", this.audioContext.state);

//create buffer source node which is used to play a sound one time
const bufferSourceNode = this.audioContext.createBufferSource();
// bufferSourceNode.channelCount = 1;
// bufferSourceNode.channelCountMode
console.log('Created buffer source node');
//set buffer to one of the loaded sounds;
bufferSourceNode.buffer = sound;
//connect to output
bufferSourceNode.connect(this.audioContext.destination);
//play the sound
bufferSourceNode.start();
//stop the sound
// bufferSourceNode.stop(this.audioContext.currentTime + 0.5);
//end  the sound
bufferSourceNode.onended = () => {
console.log("onended");
}
0

There are 0 answers