Esempio n. 1
0
        void Awake()
        {
            m_source = GetComponent <UnityEngine.AudioSource>();
            // In order to use our procedural filter as the input to the AudioSource,
            // we need to detach any potential AudioClip from it.
            // see: https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnAudioFilterRead.html
            m_source.clip = null;
            // must loop over the buffer, since it is refilled at each step.
            m_source.loop = true;
            m_source.Stop();

            m_sampleRate = MusicConfig.GetSampleRate();
        }
Esempio n. 2
0
        void Awake()
        {
            m_source = GetComponent <UnityEngine.AudioSource>();
            // In order to use our procedural filter as the input to the AudioSource,
            // we need to detach any potential AudioClip from it.
            // see: https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnAudioFilterRead.html
            m_source.clip = null;

            // must loop over buffer
            m_source.loop = true;

            m_sampleRate = MusicConfig.GetSampleRate();

            Load(file, startingNumberVoices);
        }
 void Update()
 {
     m_sampleRate = MusicConfig.GetSampleRate();
 }