Tazman-AudioRecent Updates

Recent Updates

  • Updated on: Nov 07, 2023

    Mixer

  • Updated on: Nov 07, 2023

    Inspector

  • Updated on: Nov 07, 2023

    Audio Settings

  • Updated on: Nov 07, 2023

    Runtime Parameters

  • Updated on: Nov 07, 2023

    Modulators

  • Updated on: Nov 07, 2023

    Project Hierarchy

  • Updated on: Nov 06, 2023

    Exporting an FPK

  • Updated on: Nov 03, 2023

    Glossary

  • Updated on: Feb 22, 2023

    AudioMixer Manager

    Manual Fabric Manual
  • Updated on: Feb 22, 2023

    Examples API

    <pre><code>using UnityEngine; using System.Collections; using System.Collections.Generic; public class ExamplesAPI : MonoBehaviour { &nbsp; &nbsp;public int eventID; // Use this for initialization void Start () {} // Update is called once per frame void Update () { // Example 1: Posting an event if(Input.GetKeyDown(KeyCode.Alpha1)) { ///////////////////////////////////////////////////////////// // This event by default will send the PlaySound EventAction. // The gameObject used is the one that has the FabricManager &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Fabric.EventManager.Instance.PostEvent(&quot;Simple&quot;); } // Example 2: Posting an event with a gameObject else if(Input.GetKeyDown(KeyCode.Alpha2)) { ///////////////////////////////////////////////////////////// // This event by default will send the PlaySound EventAction. // The gameObject passed is used to track position and associated with an instance if max instances property is set Fabric.EventManager.Instance.PostEvent(&quot;Simple&quot;, gameObject); } // Example 3: Posting an event with a PlaySound action and a gameObject else if(Input.GetKeyDown(KeyCode.Alpha3)) { Fabric.EventManager.Instance.PostEvent(&quot;Simple&quot;, Fabric.EventAction.PlaySound, null, gameObject); } // Example 4: Posting a stop sound event action else if(Input.GetKeyDown(KeyCode.Alpha4)) { Fabric.EventManager.Instance.PostEvent(&quot;Simple&quot;, Fabric.EventAction.StopSound, null, gameObject); } // Example 5: Posting a timeline SetParameter value else if(Input.GetKeyDown(KeyCode.Alpha5)) { Fabric.EventManager.Instance.SetParameter(&quot;Timeline&quot;, &quot;Parameter&quot;, 0.5f, gameObject); } // Example 6: Posting a SetDSPParameter value else if(Input.GetKeyDown(KeyCode.Alpha6)) { Fabric.EventManager.Instance.SetDSPParameter(&quot;Event&quot;, Fabric.DSPType.LowPass, &quot;CutoffFrequency&quot;, 5000, 5, 0.5f, gameObject); } // Example 7: Adding dynamic mixer preset else if(Input.GetKeyDown(KeyCode.Alpha7)) { // The event name must be &quot;DynamicMixer&quot; Fabric.EventManager.Instance.PostEvent ( &quot;DynamicMixer&quot;, Fabric.EventAction.AddPreset, &quot;MuteAll&quot;, null ) ; Fabric.EventManager.Instance.PostEvent ( &quot;DynamicMixer&quot;, Fabric.EventAction.AddPreset, &quot;MuteAll&quot;, null ) ; } // Example 8: Removing dynamic mixer preset else if(Input.GetKeyDown(KeyCode.Alpha8)) { // The event name must be &quot;DynamicMixer&quot; Fabric.EventManager.Instance.PostEvent ( &quot;DynamicMixer&quot;, Fabric.EventAction.RemovePreset, &quot;MuteAll&quot;, null ) ; } &nbsp; &nbsp; &nbsp; // Example 9: Get component by name, setting volume, querying if component is playing and if not play it else if(Input.GetKeyDown(KeyCode.Alpha9)) { Fabric.Component component = Fabric.FabricManager.Instance.GetComponentByName(&quot;Audio_Fabric_SFX_Test&quot;); if(component != null) { component.Volume = 0.5f; if(component.IsPlaying() == false) { component.Play(gameObject); } } } // Loading prefab that has Fabric components into the Fabric hiearchy with a target path else if(Input.GetKeyDown(KeyCode.A)) { Fabric.FabricManager.Instance.LoadAsset(&quot;NameOfPrefab&quot;,&quot;Audio_SFX&quot;); } // Unloading component from the Fabric hiearchy else if(Input.GetKeyDown(KeyCode.B)) { Fabric.FabricManager.Instance.UnloadAsset(&quot;Audio_SFX&quot;); } // Initialise default component parameters (ideal for setting parameters in animation systems) else if(Input.GetKeyDown(KeyCode.C)) { Fabric.InitialiseParameters parameters = new Fabric.InitialiseParameters(); parameters._pitch.Value = 2.0f; Fabric.EventManager.Instance.PostEvent(&quot;Simple&quot;,Fabric.EventAction.PlaySound, null, gameObject, parameters); } &nbsp; &nbsp; &nbsp; &nbsp;// Check if an event is playing &nbsp; &nbsp; &nbsp; &nbsp;else if (Input.GetKeyDown(KeyCode.D)) &nbsp; &nbsp; &nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (Fabric.EventManager.Instance.IsEventActive(&quot;Simple&quot;, gameObject)) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug.Log(&quot;Event Simple is Active&quot;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Debug.Log(&quot;Event Simple is Inactive&quot;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp;} else if(Input.GetKeyDown(KeyCode.E)) { Fabric.Component[] components = Fabric.FabricManager.Instance.GetComponentsByName(&quot;Audio_Simple&quot;, gameObject); if(components != null &amp;&amp; components.Length&gt; 0) { components[0].Volume = 0.5f; if(components[0].IsPlaying() == true) { Debug.Log(&quot;Component is playing&quot;); } } } &nbsp; &nbsp; &nbsp; &nbsp;if (Input.GetKeyDown(KeyCode.F)) &nbsp; &nbsp; &nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;eventID = Fabric.EventManager.GetIDFromEventName(&quot;Simple&quot;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Fabric.EventManager.Instance.PostEvent(eventID, gameObject); &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp;} }</code></pre>
    Manual Fabric Manual