Audio was not allowed to auto start


Eduardo Alfaro
Hello to everyone, I am trying to include some javascript audio framework library to boost-up the audio effects/playing features inside the APP... I have tried with Tone.js, Audiolet, Wad, Tuna or Howler.js but I am having the same security message/issue in console.log "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page." I have tried to solve, but nothing, I really do not know how to handle this issue... I am also trying with PHASER, a javascript framework for creating games, but having the same error. What I am doing is initialize the framework when the app is mounted, then later, trying to play a sound, mp3, effect... wherever within a button action (for example, when click) but I get no sound and the error at console.log... Do, do anyone of you could help with this issue??? Any idea or suggestions that could help??? Thank you so much!!!

DecSoft

Hello Eduardo,

Maybe we can't do nothing about the "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page." issue, since it's a browser's security check: did not allow the audio to start without an user interaction first. It's similar than the video "autoplay" option: can only work in muted videos. Just think that a website start to play audio without the user intervention... this can be very annoying and therefore the browsers try to limit it.

Maybe you can refer here a specific "audio framework" and what you are trying to do and therefore we can try to take a look around what we can do.

P.S. Try the things in external browsers in addition to the integrated debugger browser: maybe the integrated debugger browser can have some problems with audio / video which do not exists in external browsers: and finally our app works in external browsers, not in the debugger one.

P.S.2. Curiously the AudioPlayer app sample works as expected in Firefox and Edge even if we use the AutoPlay action... that is,... the audio starts automatically when the app start. However, the same don't work in Chrome in my tests. Maybe you want to take a look at this sample too, Eduardo.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.