Forum rules - please read before posting.

Using FMOD with AC

Hey, it's me again.

With the help of AC my game makes great progress and I'm incredibly grateful for it. My sounddesigner started putting the sounds together in FMOD and I wanted to know if there is a best way to combine these to. To trigger one shots as well as changing music.

All the best
Sebastian

Comments

  • FMOD isn't supported by AC, though an unofficial integration is discussed here.

    If you wanted to sync up FMOD with AC's music system and Actions, then you would need to rely on a custom script that hooks into the OnPlayMusic and OnStopMusic custom events, and extract the relevant data in order to pass it onto FMOD.

    This sample script, for example, logs information about the playback of music in the Console using this technique:

    using UnityEngine;
    using AC;
    
    public class MusicEventsExample : MonoBehaviour
    {
    
        private void OnEnable ()
        {
            EventManager.OnPlayMusic += OnPlayMusic;
            EventManager.OnStopMusic += OnStopMusic;
        }
    
        private void OnDisable ()
        {
            EventManager.OnPlayMusic -= OnPlayMusic;
            EventManager.OnStopMusic -= OnStopMusic;
        }
    
        private void OnPlayMusic (int trackID, bool loop, float fadeTime, int startingSample)
        {
            foreach (MusicStorage musicStorage in KickStarter.settingsManager.musicStorages)
            {
                if (musicStorage.ID == trackID)
                {
                    AudioClip audioClip = musicStorage.audioClip;
                    Debug.Log ("Fade in music " + audioClip + " over time: " + fadeTime + ", Looping: " + loop);
                }
            }
        }
    
        private void OnStopMusic (float fadeTime)
        {
            Debug.Log ("Stop music over time: " + fadeTime);
        }
    
    }
    
  • Hey Chris, thank you very much. I have to dive inside. I think I need it mostly for pick up sounds from items and such. I'll have a look. Thank you.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.