Logo - Crazy Minnow Studio - game, asset, tool development

Welcome to Crazy Minnow Studio! We are a small indie software development team primarily focused on game development using the Unity engine. Our pipeline includes: games, game development tools and assets, and video tutorial production. Check out our Unity lip sync asset, SALSA Lip-Sync, available on the Unity Asset Store. Follow our blog for updates on our Unity asset and game development, as well as other happenings in indie game development.

Beat Detect for Amplitude

BeatDetect is a free add-on for Amplitude 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.

 

Amplitude (Required)
https://crazyminnowstudio.com/unity-3d/amplitude-webgl/


12/19/2017 - (1.0.0) Initial release, requires Amplitude 1.0.0.


Installation Instructions

The zip file below contains a Unity package that can be imported into your project.

  1. Install Amplitude into your project.
    • Select [Window] -> [Asset Store]
      • Once the Asset Store window opens, select the download icon, and download and import [Amplitude].
  2. Install the BeatDetect add-on into your project.
    • Select [Assets] -> [Import Package] -> [Custom Package...]
      • Browse to the BeatDetect_X.X.X.unitypackage you downloaded from the download link below.

Usage Instructions

  1. Setup Amplitude as you normally would.
  2. Add the BeatDetect component.
  3. Link your Amplitude component to the BeatDetect [Amplitude] field.
  4. Add as many event triggers as you wish and set their amplitude trigger value.
  5. Setup an event listener script to recieve a Trigger parameter (see the included BeatDetectTester.cs script). BeatDetect amplitude level events emit when the amplitude rises above the trigger value, and when the amplitude dips below the trigger value. The Trigger event parameter includes the following information:
    • Trigger.value
      • Amplitude trigger value
    • Trigger.type
      • Over or Under - Amplitude has either risen above or dipped below the trigger value
    • Trigger.clipName
      • Amplitude.audioSource.clip.name
    • Trigger.clipLength
      • Amplitude.audioSource.clip.length
    • Trigger.clipTime
      • Amplitude.audioSource.time

Code Example


using UnityEngine;
using CrazyMinnow.AmplitudeWebGL;

namespace CrazyMinnow.AmplitudeWebGL
{
    public class BeatDetectTester : MonoBehaviour
    {
        public void TriggerEventListener(Trigger trigger)
        {
            switch (trigger.type)
            {
                case TriggerType.Type.Over: // Amplitude is over trigger
                    Debug.Log(trigger.type + ", " + 
                        trigger.value + ", " + 
                        trigger.clipName + ", " + 
                        trigger.clipLength + ", " + 
                        trigger.clipTime);
                    break;
                case TriggerType.Type.Under: // Amplitude is under trigger
                    Debug.Log(trigger.type + ", " +
                        trigger.value + ", " +
                        trigger.clipName + ", " +
                        trigger.clipLength + ", " +
                        trigger.clipTime);
                    break;
            }
        }
    }
}

NOTE: While every attempt has been made to ensure the safe content and operation of these files, they are provided as-is, without warranty or guarantee of any kind. By downloading and using these files you are accepting any and all risks associated and release Crazy Minnow Studio, LLC of any and all liability.

Download Files

Amplitude for WebGL
~ Make your web audio move! ~

Buy Amplitude on the Asset Store

 


Categories:Amplitude

Comments:No comments yet