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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Audio Crashes Player

Discussion in 'WebGL' started by CurtisLinden, Jun 1, 2016.

  1. CurtisLinden

    CurtisLinden

    Joined:
    Oct 26, 2015
    Posts:
    10
    WebGL support has been pretty damn incredible! It's working!

    I'm noticing crash issues with Audio.

    TypeError: Failed to set the 'value' property on 'AudioParam': The provided float value is non-finite.
    native::in TypeError
    blob:http%3A//play.blocksworld.com/08834fdc-0d45-4280-b306-3dca131b307a:1:in _JS_Sound_SetVolume

    I have noticed that the Web Audio implementation is very prone to errors - some of them come in due to having display:none and no canvas size. I have been able to work around these with very careful use of "visibility:hidden" instead of "display:none" and Pausing the Engine when ever the canvas needs to adjust size.

    I am now experiencing a similar crash while a game is running without resizing.

    I would like to see _JS_Sound_SetVolume have a guard function to check for values that are invalid instead of crashing the engine.

    I have been able to hack around this issue for positional audio by monkey-patching 'setPosition'.

    Unfortunately I cannot do this with _JS_Sound_SetVolume.

    Please could _JS_Sound_SetVolume be written in such a way as to protect assigning invalid values.

    Best,

    Curtis.

    http://blocksworld.com
    Linden Lab
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    While we could add code to check for invalid values all over the place, that is really just hiding the more fundamental issue of getting invalid values in the first place. So let's get a bug report on this with a repro case, so we can figure this out.

    Also, any chance that this issue is specific to Chrome? If it is, I might know what is causing it (and how to fix it).
     
  3. CurtisLinden

    CurtisLinden

    Joined:
    Oct 26, 2015
    Posts:
    10
    Dear Jonas,

    Thank you for your consideration and response.

    It does appear to be related to chrome. Testing in Firefox doesn't appear to crash due to audio.
     
  4. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    553
    @jonas-echterhoff do you remember what could be the issue?
    It started to randomly happen to us in some old and new builds. Only on Chrome.

    One or more runs we get
    TypeError: Failed to execute 'setValueAtTime' on 'AudioParam': The provided float value is non-finite
    at _JS_Sound_SetListenerPosition
    We clean cache and it suddenly works again