Forum rules - please read before posting.

Using FMOD for audio

Hey,

I'm working on a project where we need to use FMOD (and I'm quite used to it).
I've only started working with AC last week.

Adventure Creator's audio capabilities are actually more than enough for this but.... It's a requirement to use FMOD. I think it will also help out with trying different audios while we're in development.

My question is this: FMOD has its own listener and it's own events.
What do I need to change in the code, including the sfx and music volume, so I can send events to FMOD that match the behaviour of AC?

Comments

  • Welcome to the community, @ragingbass2020.

    You can get AC's built-in Music and SFX volume levels with these snippets respectively:

    AC.Options.GetMusicVolume ()
    AC.Options.GetSFXVolume ()
    

    You can also create your own options by creating a Global variable (such as a Float, to denote volume) and setting its Link to property to Options Data. You can then read/write its value either with Actions, or though script. The Manual's "Variable scripting" chapter guides you through how to do the latter.

    When it comes to matching AC's behaviour, the workflow is typically to rely on custom event hooks, rather than having to modify AC's codebase itself. For example, you can hook into the OnStartSpeech event to run custom code whenever a character speaks - and also extract the AC-defined audio file along with it:

    private void StartSpeech (AC.Char character, string lineText, int lineID)
    {
        SpeechLine speechLine = KickStarter.speechManager.GetLine (lineID);
        AudioClip audioClip = speechLine.customAudioClip;
        // or, as string data embedded in the line's description:
        string audioData = speechLine.description;
    }
    

    Once you've gotten the audio data and used it to play it via custom means, you can then prevent AC from playing audio itself by unchecking Auto-play speech audio files? in the Speech Manager.

    You can also create custom Actions that let you invoke FMOD functions. A couple of (unofficial) Actions from another user can be found here:

    https://github.com/duartegarin/Adventure-Creator-FMOD

  • Thanks so much! This was what I was looking for!

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.