Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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:
    1,086
    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:
    1,086
    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:
    1,086
    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:
    1,086
    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,292
    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:
    1,086
    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,292
    Well that explains why I never got it to work. :rolleyes:

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

    sergiosoba

    Joined:
    Apr 28, 2017
    Posts:
    7
    Hi,

    My target is WebGL and I know that I should use SALSA with Amplitude. If I also want to compile for Android, should I make any modifications to the project?
     
  12. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,086
    Hi sergiosoba,

    Amplitude for WebGL is only compatible with WebGL, and only necessary to make SALSA work on WebGL.

    Michael
     
  13. sergiosoba

    sergiosoba

    Joined:
    Apr 28, 2017
    Posts:
    7
    If I compile to Android too, gives Amplitude problems or I have to modify it?

    I wanna compile en both.
     
  14. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,086
    The recommended approach is to build to your other platforms without the Amplitude asset since it was not designed for any other platform.
     
    sergiosoba likes this.
unityunity