Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Amplitude for WebGL

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

  1. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398

    From the creators of SALSA Lipsync

    Website: CrazyMinnowStudio.com
    Product site: Amplitude
    Support email: assetsupport@crazyminnow.com

    Amplitude is a Unity3D asset that provides access to audio amplitude and frequency data on the WebGL platform, where the Unity API does not. It offers a clean and simple custom Inspector, and leverages a standard Unity AudioSource component. The custom inspector communicates with a native JavaScript library, allowing it to make function calls directly against the underlying web browser's Web Audio API.
    • WebGL amplitude and frequency.
    • Native JavaScript library accesses Web Audio API directly.
    Amplitude is easy to use, simply add the component, link your Unity AudioSource to the Amplitude AudioSource field, set the Data Type (Amplitude or Frequency), set the sample size, and set an amount of boost if desired. Play your audio using the normal Unity AudioSource API. While your audio is playing, Amplitude exposes a float array of the size you specified, and an average. The values range from -1 to 1 for amplitude, and 0 to 1 for amplitude absolute values or frequency.
    • Read amplitude/frequency values from the [sample] float array property.
    • Read amplitude/frequency average from the [average] float property.
    Being the creators of SALSA Lipsync, we of course also created a SALSA lip-sync add-on that allows SALSA to leverage Amplitude for WebGL-based character lip-sync. The SALSA add-on (AmplitudeSALSA) is free for Amplitude customers using the link below.


    **AmplitudeSALSA is a separate free download for SALSA customers.

    • Combine Amplitude, SALSA, and our free AmplitudeSALSA add-on for WebGL-based character lip-sync.
    The sample scene includes a 64 sample UI prefab that allows you to monitor results, and set sample size and data type within a WebGL build.








    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using CrazyMinnow.AmplitudeWebGL;
    4.  
    5. public class AmplitudeTester : MonoBehaviour
    6. {
    7.     public Amplitude amplitude;
    8.     public Slider uiSlider;
    9.  
    10.     // Read the amplitude sample or average values
    11.     // while the AudioSource AudioClip is playing
    12.     void Update()
    13.     {
    14.         if (amplitude.audioSource.isPlaying)
    15.         {
    16.             // Access the amplitude average
    17.             uiSlider.value = amplitude.average;
    18.  
    19.             // Or access the sample array
    20.             // for (int i = 0; i < amplitude.sample.Length; i++)
    21.             // {
    22.             //  uiSlider.value = sample[i];
    23.             // }
    24.         }
    25.     }
    26.  
    27.     // Example method calls the AudioSource.Play method
    28.     public void Play()
    29.     {
    30.         amplitude.audioSource.Play();
    31.     }
    32.  
    33.     // Example method calls the AudioSource.Stop method
    34.     public void Stop()
    35.     {
    36.         amplitude.audioSource.Stop();
    37.     }
    38. }
     
    Last edited: Feb 27, 2018
    theANMATOR2b likes this.
  2. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Amplitude has been submitted to the Unity Asset Store. It should be available in a week or so. We reached out to Unity to check if we can use the asset upgrade tools to offer a discount to existing SALSA customers.
     
  3. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    We will be temporarily offering a cross product upgrade for Amplitude to existing SALSA customers. If you own SALSA, you will be able to purchase Amplitude for 25% off the regular price of $25, taking the price down to $18.75.
     
  4. deleo

    deleo

    Joined:
    Oct 4, 2013
    Posts:
    4
    Any word on whether this app is available yet? I cannot find it in the UAS. Thanks
     
  5. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Hello deleo,

    Thanks for your interest. We are still waiting for Unity approval, which is supposed to take about two weeks or 10 working days. We'll post here, and to our Facebook and Twitter feeds once it's live.

    Michael
     
  6. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398

    We've built a free add-on for Amplitude called BeatDetect that allows you to easily create amplitude level event triggers. You can use these events to respond to sounds or music on the WebGL platform.



    BeatDetect is available through our website, but requires a valid Amplitude invoice number, so be sure to grab it after you pick-up Amplitude on the Unity Asset Store (once it's live).

    https://crazyminnowstudio.com/posts/beat-detect-for-amplitude/
     
    Last edited: Dec 19, 2017
  7. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398

    We have posted the AmplitudeSALSA add-on details to our website. AmplitudeSALSA is a free Amplitude add-on that acts as a bridge between SALSA and Amplitude to allow SALSA Lipsync to work on the WebGL platform.



    AmplitudeSALSA is available through our website, but requires a valid Amplitude invoice number, so be sure to grab it after you pick-up Amplitude on the Unity Asset Store (once it's live).

    http://crazyminnowstudio.com/posts/salsa-lipsync-in-webgl-with-amplitude/
     
  8. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
  9. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
  10. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
  11. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    The current Amplitude build v1.0.1 provides audio amplitude levels from WebGL. The next update v1.1.0 will add audio frequency access from WebGL. Where amplitude is useful for average audio level, frequency is useful for providing amplitude level isolated out by audio frequency across the sample array. For example, if you are capturing an array of 64 frequency samples on a music track with bass and snare drum, there is a good chance that you could isolate those frequencies and use our Beat Detect add-on to trigger off of each hit independently. We're also updating our Beat Detect add-on to adapt to the new amplitude/frequency type options. When using amplitude, the triggers monitor the average, when using frequency, an additional index field appears so that you can select the sample index you want to monitor. Last but not least, we're adding some UI prefab and sample scenes to make testing and tuning easier from within a WebGL build.
     
    Last edited: Jan 22, 2018
  12. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Amplitude 1.1.0 has been submitted to the Asset Store and brings amplitude and now frequency processing to the WebGL platform. If you want to using SALSA lipsync in WebGL, grab our AmplitudeSALSA add-on. If you want to do awesome frequency-base beat detection, grab our Beat Detect add-on.

    Amplitude 1.1.0 replaces the 32 sample UI with a 64 sample UI prefab that allows boost, switching sample size and data types (amplitude/frequency) in a WebGL build. Beat Detect 1.1.0 has been adapted to Amplitude 1.1.0 and includes Trigger spawner configurator UI prefab and a log output for testing and tuning in a WebGL build.

    Try our new WebGL demos:
    Read the release note here.
    https://crazyminnowstudio.com/unity-3d/amplitude-webgl/release-notes/

     
    Last edited: Jan 25, 2018
  13. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Last edited: Feb 5, 2018
  14. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Hello -- Unity just deprecated our package without warning. We have been trying to work with them to clean up the issue with the SALSA reviews appearing under the Amplitude asset and they executed our proposal without communicating the feasibility with us and letting us contact current and potential customers.

    Rest assured, if you already purchased Amplitude, you did not purchase a dead-end product and will have a product page and asset to work with. We are trying to contact someone at Unity to find out what is going on and when/how it will be fixed. Please stand by, we appreciate your patience.
     
  15. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Ultimately what we believe will happen (as far as what we proposed to them [Unity]):

    • The assets will be removed (which is what already happened).
    • They will be recreated as stand-alone assets without the cross-product upgrade (Unity is unable to support this mechanism).
    • Existing customers will be transferred to the new products (and notified).
    • The cross-product promotional pricing will no longer be available.
    They completely bypassed the "communicate with us" bullet point we proposed -- so we cannot confirm how the rest of this is going to play out. We apologize for this situation and humbly ask for and appreciate your patience.
     
  16. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    As we hoped was not the case, Unity did step 1 of what we proposed and then passed it back to us this morning as if the whole proposal was complete. Needless to say, we are still trying to get this all sorted out.

    On a positive note, if you have already purchased this product, the add-on downloads are still available to you, simply use the invoice number you received when you purchased.
     
  17. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    I guess it is all because Unity does not have a category that allows side-grades…. :rolleyes:
    Well, I appreciate that you made a customer discount available at least for a little while.

    Amplitude is working great. I hadn't bothered with WebGL because I couldn't use SALSA.... Now i feel like I have a lot of catch-up to do.:cool:
     
    Crazy-Minnow-Studio likes this.
  18. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    That's more or less the case. Initially, we were led to believe it was all possible (and so we went forward with implementation). They failed to mention the grossly undesirable side-effect of copying the reviews from SALSA to each product. Of course, Unity told us after-the-fact it was a side-effect and they had no means of removing the linked reviews. We then proposed an idea and they exercised one part of it without discussion and then checked out. Communication is certainly not their forte.

    We are super happy you are enjoying Amplitude...can't wait to see how you put it to use! ;)
     
    wetcircuit likes this.
  19. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    After the attempted cross-product promotional pricing fiasco, Amplitude has been re-submitted to the Asset Store.
     
  20. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    wetcircuit likes this.
  21. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    The Asset Store team informed us that existing Amplitude customers would be transferred over to the republished asset. Please email us at assetsupport@crazyminnow.com if this is not the case.

    Thanks!
     
  22. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    I'm loading my audio clip from an URL and storing it as a Playmaker variable, then using the SALSA Playmaker actions to Set the audioclip on my Salsa figure and Play.

    This works in the Editor, but I suspect the editor is not actually using Amplitude.

    When I build to WebGL, I hear the audio but my figure is not SALSA-ing.

    I have tried other actions to change the audioclip, including Playmaker Audio actions and Unity event.

    If I build the scene with an audioclip pre-loaded, it will SALSA that audio until I change the audio clip. Then the mouth stops (even though I can hear the audio and it is apparently playing through the figure's Audio Source).

    Am I missing something?
     
  23. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    My first thought is that it may be related to the streaming audio, but we'll need to do some testing and get back to you on that. Does it work if your are changing local AudioClips instead of streaming them from a URL?

    Michael
     
  24. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Same. The first clip SALSAs. The second clip is heard but no SALSA.
     
  25. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    I'm recreating your scenario, are you using your own custom action to fetch the AudioClip using www, or are you using something from the PlayMaker Ecosystem?
     
  26. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    from the ecosystem, called WWWPOSTMobile.
     
  27. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    After a bit of testing with my own script and with the WWWPOSTMobile action, I found they both work but it seems necessary to add approximately one second of delay between the end of fetching the audio file and setting and playing the clip. I'm not positive why this is the case, but I suspect a WebAudioAPI limitation with audio streams. I'm still looking for a definitive answer. In the meantime, you can use the steps below to get up and running for now.
    • WWWPOSTMobile.IsDone -> Wait (1 second) -> SetAudioClip & Audio Play
    Michael
     
    wetcircuit likes this.
  28. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Interesting! Wow, thank you for having the patience to discover that workaround…. I will try "pre-loading" the audioclips.

    Amplitude has got me looking seriously at WebGL for the first time, and there are quirks. It's another learning curve. LOL.
     
    Crazy-Minnow-Studio likes this.
  29. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Well, it is not working in my scene even after a 20sec pause…. But the fact you saw the issue(?), then got it to work by giving Unity some breathing space, makes me suspect there is a little voodoo involved in audio formats, maybe compression and memory too. I will keep playing around, and look if there are known webGL audio issues….

    My goal is to get it to work with a long streaming audio file. Unity has a webGL streaming audio asset in the store but it throws errors in current Unity so I don't know what the status is.

    As usual, thanks so much for your time!
     
  30. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    We are in active communication with the Unity team, and they assure us that they are working on transferring customers who purchased the previous store versions of Amplitude and/or the MorphMixer asset. We're extremely disappointed in the way Unity's cross-product upgrade offering was handled and the bad information we received about it's feasibility.

    Team Crazy Minnow
     
  31. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Hello, we have been in communication with the two top Unity Asset Store personnel and are trying to resolve the issue with transferring customers from the old deprecated assets to the new assets. Let us just say we are extremely disappointed and frustrated with how this is going. However, we are not deterred and are staying in communication with them to reach resolution.

    In the meantime, if you are an owner of the original asset and do not have the package in your local cache, please email us (assetsupport@crazyminnow.com) your invoice number and we can send you a fresh package. If you are interested in downloading the add-ons available for MorphMixer or Amplitude, you may still do so using your old invoice number.

    New customers are not affected by this issue.

    Thanks!
    Team Minnow
     
  32. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    We finally received word back from Unity late last night and our understanding is this issue is now resolved. The vouchers received by owners of the Unity-deprecated assets (MorphMixer and Amplitude) are sale-transfer vouchers and essentially transfer the purchase to the new asset. They are not the same as vouchers issued by the publisher. If you purchased the original MorphMixer or Amplitude, prior its deprecation, and did not receive a voucher to transfer your purchase to the new asset, please contact Unity support (support@unity3d.com) to request your voucher.

    We sincerely apologize for all of the nonsense centered around this issue.
     
  33. akshay_shah

    akshay_shah

    Joined:
    May 19, 2017
    Posts:
    16
    Any update on that 1 min workaround thing? That works for me, but restricts me playing 2 audio files one after another immediately.. It unnecessarily adds a gap of 1 sec between them, which does not sound good as a user.
     
  34. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    I supposed you could pre-load your multiple dialogue clips so that they're ready when you need them

    .Michael
     
  35. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    To clarify, working with web-based audio files is not an Amplitude issue. These types of files need to be handled in a special manner to ensure the AudioClip is handled and loaded appropriately before handing it off to Amplitude. While this technically is out-of-scope for Amplitude support, we have an add-on we are putting together to simplify this process in both on-demand action format and bulk-processing batch format.

    Once we have completed our testing, we will publish the add-on in the Amplitude downloads section on the CrazyMinnowStudio.com website.

    Thanks,
    Darrin
     
    akshay_shah and wetcircuit like this.
  36. akshay_shah

    akshay_shah

    Joined:
    May 19, 2017
    Posts:
    16
    Thanks Darrin for your reply.
    Will wait for the add-on. A couple of queries:
    - How do I make sure I get notified when the add-on gets published? Is there some place where I can register for the same?
    - Any rough estimate as to when can I expect the add-on to be published?
     
  37. akshay_shah

    akshay_shah

    Joined:
    May 19, 2017
    Posts:
    16
    Pre-load will not have any affect really for me as I am creating audio clip at runtime by downloading data using WWW.GetAudioClip() and once the data is available I immediately do audioClip.LoadAudioData()
     
  38. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Hello @akshay_shah, we do most of our notifications on Twitter and these forum threads. We also make notifications on Facebook but are perhaps, a little less consistent there, but trying to do better. :)

    I believe I will get the add-on uploaded today with very rudimentary documentation in the read.me file. Website documentation will follow shortly after and a video is planned after that. Hope that helps!
     
  39. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Hello again @akshay_shah! Actually what Mike was suggesting was caching your files as AudioClips (doing the fetching all at once and save the results) so that you can then play the clips as needed without delay. The good news is, a batch mode is available in the add-on we are uploading shortly. Meaning, you can send all of your URLs and AudioTypes to the processor at once and it will convert and hold the results in a queue of AudioClips. You can then consume these clips as needed, without any delays. It is very simple to use and works well. Your clips are all cached and saved in memory until needed -- which could be a drawback, depending on the size and number of clips you have, but will certainly eliminate the delay.

    In contrast, on-demand fetching of files is rather quick: however, the Internet is a huge system of delays and variables and intermittent consistency.
     
  40. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Hello Amplitude users, we have just uploaded an add-on (download) that provides an API for creating AudioClips from web-based audio files. The API implements a web-friendly, asynchronous callback when the files are ready. There is an additional supporting "examples" package that demonstrates very basic usage of the WebAudioUrls add-on framework. Minimalistic documentation is included in the read.me file for WebAudioUrls (additional documentation in development on our website).

    Features implemented:
    • single-action mode: send a URL, get an AudioClip.
    • batch-mode: send one or more URLs to be processed; request the results as needed. This mode uses a queue for the URLs sent to the WebAudioUrlProcessor, allowing URL sending to be performed as needed. It also uses a queue for the processed AudioClips, so they can be removed from the queue as needed.
    Hope this helps the previous questions in this thread, as well as any other users wondering how to implement something like this.
     
    wetcircuit likes this.
  41. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
  42. akshay_shah

    akshay_shah

    Joined:
    May 19, 2017
    Posts:
    16
    This utility looks promising.. Will try it!
     
    Crazy-Minnow-Studio likes this.
  43. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    If you want to add lip-sync to your characters on WebGL, check out how you can use Amplitude, our free AmplitudeSALSA add-on, and our SALSA LipSync asset on WebGL.

     
  44. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    We just published a video tutorial covering our Amplitude add-on, WebAudioUrls, for web-based audio resources.

     
  45. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Hello – we discovered Unity changed their invoice-check server address without notifying publishers. We have updated our system and have confirmed the downloads invoice confirmation is working. We apologize for the inconvenience.
     
  46. Lemonlemons

    Lemonlemons

    Joined:
    Jun 10, 2017
    Posts:
    1
    Hi Crazy Minnow, big fan!

    Excited to use SALSA on Webgl but first I wanted to make sure: Does SALSA work with RTVoice in Webgl?

    Thanks!
     
  47. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Lemonlemons likes this.
  48. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    After a customer reported errors in 2018.3, we have confirmed that Unity introduced a regression BlendShape bug that will produce the following errors when trying to use SALSA and Amplitude on WebGL:

    "Platform does not support compute shaders"
    "d3d11: failed to create buffer (target 0x1c mode 0 size 5360) since compute isn't supported at this feature level"

    For now, please use 2018.2 or earlier, and vote on the following issue.

    https://issuetracker.unity3d.com/is...with-blendshapes-throws-the-error-and-warning

    Thanks!
     
  49. Jeps66

    Jeps66

    Joined:
    Jun 23, 2015
    Posts:
    9
    Hi
    I have a project where I use Salsa and Dialogue System together. I wanted to make it work on WebGL as well and so I bought Amplitude and downloaded Amplitude Salsa as well. However I have a problem now. If I remove the audio source from the Salsa2D component then the Salsa commands from the Dialogue System only loads the audioclip into the Salsa2D component and not into the audio source, and no audio plays. If I keep the audio source in the Salsa2D component then everything works in the editor but the Salsa animations don't play in WebGL.
    Can you give me some ideas on the easiest way to solve this issue? Thanks!

    Jeppe
     
  50. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    1,398
    Hi Jeppe,

    I haven't tried this, but you might be able to use the Dialogue System Audio(clip) sequencer command instead of the SALSA(clip) sequencer command. I believe this targets the AudioSource component directly. Keep in mind if you are streaming in Audio, this likely won't work since that requires special consideration as well.

    https://crazyminnowstudio.com/posts/accessing-web-based-audio-resources-in-amplitude/