No Audio but OK result using programmer sound

Trying to play audio from a programmer instrument/sound or sound guy made. To avoid any issue I just copy paste your example code.
Debugging the result (using . file extension) I’m getting

Sound Result: OK Key: A010401_03_Lili.wav
UnityEngine.Debug:Log (object)
ScriptUsageProgrammerSounds:DialogueEventCallback (FMOD.Studio.EVENT_CALLBACK_TYPE,intptr,intptr) (at Assets/zzTests/ScriptUsageProgrammerSounds.cs:65)

But can’t hear a thing.

UPDATE: putting the audio files in the StreamingAssets folder solved the issue. Is this by design?

1 Like

Hi,

Yes, the callback is checking for "." in the key on line 64 in the example. If it is present the it will check the StreamingAssets folder for the audio file. That is why it can find your file when it is added to the StreamingAssets folder.

However, it should not be returning OK when it is obviosly failing to create the sound. I have passed it on to our development team to look into further. Thank you for bringing this to our attention.

In the meantime, a workaround you could use is adding a check below line 74. This will stop the event if the audio file is not present in the StreamingAsssets folder.

if (!File.Exists(Application.streamingAssetsPath + "/" + key))
{
	FMODUnity.RuntimeUtils.DebugLogWarning("[FMOD] Audio file does not exist in StreamingAssets folder. Stopping Event");
	instance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
	return FMOD.RESULT.ERR_FILE_NOTFOUND;
}

Thank you again, hope this helps!

Hi thank you for your answer. What I cannot uderstand is that our sfx designer configured the bank to have the vo file in it. So it I play it without .wav file I get an error, does this mean that there’s something wrong with the banks?

It’s ok to use streaming assets folder for VO file on any platform (console included) or we should investigate why the files are not found when inside the bank?

Hi,

Something to check is the keys you are using to trigger the audio files in the table are correct:
image
image

What error are you seeing?

Streaming Assets would not be recommended as there are limits on the amounts of streams that some consoles can support which may limit the around of voice lines playing at once. Streaming Assets is recommended for longer audio files like background music (FMOD Studio | Managing Assets - Loading Modes).

Hope this helps!