Liveupdating with programmer sounds

Is it possible to modify programmer sounds and have that reflected with live updating? It doesn’t seem to work and I wondering if I’m doing something wrong.

Hi,

Could you elaborate on what you mean by “modify”? Could you also share how you have set up your programmer sounds? And are you still able to modify other sounds through Live Update?

Thanks!

I have some programmer sounds and I want to adjust volume and other effects. I pull the .wav file into an external editor, make my changes and save it. The changes are not picked up by FMOD until I build banks. Live Update works fine for non-programmer sounds.

Hi,

Are your programmer sounds receiving their audio files from an Audio Table? If so, instead of receiving the audio files from the table, which would require rebuilding its banks to receive any changes. You can pass in the audio files from your directory straight into the programmer sound using the API.

To do this you can follow the Dialogue and Localization Scripting Example, changing a few elements as follows.

When initializing the programmerSoundContext.dialogueString or the ‘key’, you will instead want to set this to the full path of the audio file you want to play and modify.

 programmerSoundContext.dialogueString = "C:/Source/media/audioFile.wav";

We will want to change the programmerSoundCallback function to look like this:

FMOD_RESULT F_CALLBACK programmerSoundCallback(FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE *event, void *parameters)
{
   FMOD::Studio::EventInstance *eventInstance = (FMOD::Studio::EventInstance *)event;

   if (type == FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND)
   {
       // Get our context from the event instance user data
       ProgrammerSoundContext *context = NULL;
       eventInstance->getUserData((void **)&context);

       // In the scripting example you would be initializing the FMOD_STUDIO_SOUND_INFO here but we can just skip that 

       // There are some differences when creating the sound 
       FMOD::Sound *sound = NULL;
       // Instead of using info.name_or_data, use context->dialogueString
       // Instead of using all the FMOD options for the 2nd parameter, use FMOD_DEFAULT
       // Instead of using &info.exino, use 0
       context->coreSystem->createSound(context->dialogueString, FMOD_DEFAULT, 0, &sound);

       FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES *props = (FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES *)parameters;

       // Pass the sound to FMOD
       props->sound = (FMOD_SOUND *)sound;
       // Instead of using info.subsoundindex, use -1
       props->subsoundIndex = -1;
   }
   else if (type == FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND)
   {
       FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES *props = (FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES *)parameters;

       // Obtain the sound
       FMOD::Sound *sound = (FMOD::Sound *)props->sound;

       // Release the sound
       sound->release();
   }

   return FMOD_OK; 
}

You should now be able to access the audio files from your directory and any modifications you do to them during runtime should be picked up by Live Update without needing to rebuild the banks.

Hope this helps!

Thanks, this helps.

1 Like