Hello! I apologize in case my wording is not 100% correct, but I am building an audio editor inside a game I’m working on. This editor needs to be able to visualize the waveform of a “file” in the following way:
- y axis : loudness, x axis: time
- y axis: frequency, x axis: time, intensity of color: intensity of loudness (like a spectrogram)
think something like izotope’s RX visualization.
Now, I’ve been trying to get the necessary information out of several FMOD events, in order to read the PCM data without ever playing the event. But I’m a bit stuck. Which would be the best option for me to get this data and convert it visually inside Unity?
Thanks!
Filippo
Hi,
We have two scripting examples for visualizing waveform’s in Unity:
However, both these examples require playing the event to get the waveform data.
An option may be using the core API system to extract the information directly from the sound: FMOD Engine | Core API Guide - Extracting PCM Data From a Sound, this does not require playing the event or sound.
Hope this helps!
Hi Connor, thank you for these pointers!
I’ll try using the core API. So far, I’m getting some errors about not being able to access the channels, but this is also due to the fact that my coding skills are… somewhat limited 
I probably need to create a buffer for the data, right?
Anyways, of I have a more concrete question about this, I’ll ping again.
Filippo
1 Like
Yes, that is outlined in the Extracting PCM Data From a Sound:
buffer = new byte[(int)length];
sound.readData(buffer);
Don’t hesitate to reach out with anymore questions!