Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug (Case 1404580) [WebGL][Audio] Regression - Browser audio error for audio source

Discussion in '2022.1 Beta' started by matt_cauldron, Feb 21, 2022.

  1. matt_cauldron

    matt_cauldron

    Joined:
    Dec 17, 2021
    Posts:
    48
    Audio source in scene on browser after building throws the error:

    Code (CSharp):
    1. NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
    2. play@[native code]
    3. _startPlayback@http://localhost:61120/Build/playaudio.framework.js.gz:3:44469
    4. @http://localhost:61120/Build/playaudio.framework.js.gz:3:44888
    5. playUrl@http://localhost:61120/Build/playaudio.framework.js.gz:3:40730
    6. _JS_Sound_Play@http://localhost:61120/Build/playaudio.framework.js.gz:3:49027
    7. wasm-stub@[wasm code]
    In Unity 2020.3.25, the same setup works fine - once the user clicks in the browser the audio can be heard and no error is thrown.

    Thanks!

    Matt
     
unityunity