Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. Unity 2017.3 has arrived! Read about it here.
    Dismiss Notice
  3. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    492
    [​IMG]
    From the creators of SALSA Lipsync

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


    Amplitude is a Unity3D asset that provides beat detection and amplitude data on the WebGL platform. Unity uses the FMOD audio framework on all of their distribution platforms except WebGL, where they use a wrapper for the browser-based Web Audio API. Unfortunately, this means many of the more sophisticated tools for audio analysis simply are not available on the WebGL platform. Amplitude uses a native JavaScript library to communicate directly with the underlying web browser to access Web Audio API capabilities that have not been exposed by the Unity API wrapper.
    • WebGL beat detection and amplitude.
    • 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 Sample Size as a multiple of 2 (32, 64, 128, etc.), an amount of boost if desired, and whether or not you want your output to use absolute values. Play your audio using the normal Unity AudioSource API by accessing the AudioSource directly or through Amplitude's AudioSource reference. While your audio is playing, Amplitude exposes a float[] array of the size you specified, and a float average amplitude. The values range from -1 to 1, or 0 to 1 with Absolute Values enabled.
    • Read amplitude values from the [sample] float array property.
    • Read amplitude average from the [average] float property.
    It comes with a clean and simple custom inspector, and of course we 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 available for download from our downloads page, free for SALSA customers. You must have SALSA, Amplitude, and the free AmplitudeSALSA add-on to use SALSA on the WebGL platform.

    [​IMG]
    **AmplitudeSALSA is a separate free download for SALSA customers.
    [​IMG]
    • Combine Amplitude, SALSA, and our free AmplitudeSALSA add-on for WebGL-based character lip-sync.
    A sample scene is also included that displays the output from 32 samples, and the amplitude average, while playing a music loop.

    [​IMG]



    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: Jan 19, 2018 at 5:35 AM
    theANMATOR2b likes this.
  2. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    492
    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:
    492
    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:
    492
    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:
    492
    [​IMG]
    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.

    [​IMG]

    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:
    492
    [​IMG]
    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.

    [​IMG]

    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:
    492
  9. Crazy-Minnow-Studio

    Crazy-Minnow-Studio

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

    Crazy-Minnow-Studio

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

    Crazy-Minnow-Studio

    Joined:
    Mar 22, 2014
    Posts:
    492
    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.

    Amplitude_1.1.0.png