Getting the audio data of a Programmer Sound File in Unity

Hi, this is a bit of an esoteric question, but I wanted to know if there’s a straightforward way to get the audio data of a programmer sound from the Unity FMOD Studio API?

The end goal is to draw waveforms of our dialogue, in game. The equivalent behavior in Unity built-in audio would be the AudioClip.GetData() method.

Will this require FMOD Core? If so, what’s the best way to get this functionality into Unity? I’m pretty fluent with the Unity integration, but Core is a bit intimidating.

Here is a link to a solution using a DSP to get the spectrum data, this can be used for a single event or a bus, it was made for an older version of FMOD but it should not need much to get it working in 2.00 or 2.01.

I have made a task to add this to our scripting examples on the website as it is something that gets a few requests.

thanks for the response!

This is very useful, looking forward to the new scripting example. I think perhaps i wasn’t entirely clear in my question though. I’m trying to draw the waveform in a static manner - similar to how audio clips appear in fmod studio:

I’ve found some example code on the forums that does this with the core api using Sound::readData , but my head is spinning a bit with how to store the data from the callback in a public variable that my line renderer can access.

I’m assuming I need follow the example of the timeline callback, and create a new class to store the array?

Sound::readData works the same way AudioClip.GetData() does, it reads the data from a Sound into an array. I’m not sure which callback you are referring to but something like the FMOD_SOUND_PCMREAD_CALLBACK could be another way of getting access to the sound data.