HSU-ANT / beaqlejs

*BeaqleJS* provides a framework to create browser based listening tests and is purely based on open web standards like HTML5 and Javascript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Playback issue on Chrome, suspended audioContext

ccdarabundit opened this issue · comments

Hello, and thank you for providing this project. I recently found a bug in Chrome during playback. The audioContext was suspended and not producing audio, this was my fix in beaqle.js in the AudioPool play function.

if (this.waContext.state == 'suspended') // Need to release audioContext
                    {this.waContext.resume();}
                audiotag.play()

I added a corresponding this.waContext.suspend() in the stop function, but unsure if that was necessary. These bug fixes may not be the ideal way of handling the issue. Maybe the solution is to update the AudioPool object to use the WebAudio API in all browsers as it is (now) more widely adopted?