Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Amplitude for WebGL

Discussion in 'Assets and Asset Store' started by Crazy-Minnow-Studio, Dec 7, 2017.

  1. Jeps66

    Jeps66

    Joined:
    Jun 23, 2015
    Posts:
    9
    Thanks for your quick reply. Your solution is very easy to implement and after setting the boost everything works fine in the editor. The audio source is removed from the Salsa2D component, and audio and Salsa animation plays. So I thought I was done, but unfortunately I still don't get the Salsa animations in WebGL (tested in Edge and Chrome). I left all Amplitude settings at default except boost which is set at 0.4.
    So I have to ask for your input again. Before your fix I could understand why it didn't work, but now everything is set according to the manual and I'm puzzled why the WebGL doesn't work.
    Again thanks for your assistance.

    Jeppe
     
  2. Jeps66

    Jeps66

    Joined:
    Jun 23, 2015
    Posts:
    9
    Just found out some more. It's only the first time a dialogue is played that the Salsa animations don't play in WebGL. If I play the dialogue again the animations are there.
     
    Crazy-Minnow-Studio likes this.
  3. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    907
    That's helpful, that means it's probably an issue with loading and attempting to play the audio file before it's ready. Keep in mind that Amplitude is 100% using your web browsers underlying audio framework (Web Audio API), and not the FMOD framework Unity uses on all other platforms, so the rules are a bit different. Web Audio API will typically output errors about being unable to find the analyzer if you try to play a clip before it's fully loaded. Are you getting errors in the javascript console in your browsers developer tools?
     
  4. Jeps66

    Jeps66

    Joined:
    Jun 23, 2015
    Posts:
    9
    Yes, that is exactly the error I'm getting in the console. "Could not find analyzer (-6536)". It appears thousands of times while the audio is playing the first time. Even the interruption of starting the JS console (or activating another tab) and going back in game will stop the errors and the animations start working.
    I'm not sure how to get this fixed. I'm starting the audio with the sequencer Audio command in Dialogue System (as you suggested), so I don't have control over the loadstate of the AudioClip (if that is what is needed). I tried changing the import settings (the Load type) on the Audio Clip but nothing I tried made any difference.
    I hope you have some ideas. I really appreciate your help.

    Jeppe
     
  5. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    907
    Good, now we know exactly what the problem is, we definitely need control over the load state. This could probably be solved by leveraging our WebAudio URL's add-on, but it would likely require some custom integration to hook that process into the Audio(clip) sequencer command source code. Give us some time to research and contemplate an easier more universal way to solve this. In the meantime, please send your Amplitude invoice number to assetsupport@crazyminnow.com.

    Thanks,
    Michael
     
  6. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    907
    For anyone else using SALSA, Amplitude, and Dialogue System on WebGL, the solution is to use Amplitude v1.2.0 (submitted to the Asset Store on 05/23/2019) and the Dialogue System Audio(clip) sequence command to direct audio clip changes directly to the AudioSource instead of the SALSA(clip) sequence command.
     
  7. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    907
    We have updated and published AmplitudeSALSA for SALSA LipSync v2. This allows SALSA LipSync v2 to produce lip-synchronization on WebGL platforms.

    NOTE: The minimum requirement for using this updated Amplitude add-on with SALSA LipSync v2 is Unity version 2017.2+.

    For information, please see this blog post.
     
    wetcircuit likes this.
  8. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,073
    In a tutorial video you mention that Amplitude does not work in Safari…. Is that still true?
     
  9. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    907
    The last time we tested Safari was in May. I've looked through Apples Safari release notes and don't see anything about Web Audio API, so I suspect it's the same. It's currently supported in Google Chrome, Firefox, Opera, Microsoft Edge, and Vivaldi, but not supported in IE or Safari.
     
    wetcircuit likes this.
  10. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,073
    Well that explains why I never got it to work. :rolleyes:

    (WebGL is all over the place)
     
    Crazy-Minnow-Studio likes this.