# Visualizing both classic Loudness x Time and Spectrogram

**URL:** https://qa.fmod.com/t/visualizing-both-classic-loudness-x-time-and-spectrogram/22551
**Category:** Unity
**Tags:** unity, csharp
**Created:** [January 28, 2025, 11:13am UTC](https://qa.fmod.com/t/visualizing-both-classic-loudness-x-time-and-spectrogram/22551 "2025-01-28T11:13:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fbpsound](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/fbpsound/32/2451_2.png) [@fbpsound](https://qa.fmod.com/u/fbpsound)
#### Post date: [January 28, 2025, 11:13am UTC](https://qa.fmod.com/t/visualizing-both-classic-loudness-x-time-and-spectrogram/22551/1 "2025-01-28T11:13:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [January 29, 2025, 2:59am UTC](https://qa.fmod.com/t/visualizing-both-classic-loudness-x-time-and-spectrogram/22551/2 "2025-01-29T02:59:45Z")

</div>

Hi,

We have two scripting examples for visualizing waveform’s in Unity:

- [Unity Integration | Scripting Examples - DSP Capture](https://fmod.com/docs/2.02/unity/examples-dsp-capture.html)
- [Unity Integration | Scripting Examples - Spectrum Analysis](https://fmod.com/docs/2.02/unity/examples-spectrum-analysis.html)

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](https://www.fmod.com/docs/2.02/api/core-guide.html#extracting-pcm-data-from-a-sound), this does not require playing the event or sound.

Hope this helps!

---

<div class="post-metadata">

### Author: ![fbpsound](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/fbpsound/32/2451_2.png) [@fbpsound](https://qa.fmod.com/u/fbpsound)
#### Post date: [January 29, 2025, 2:02pm UTC](https://qa.fmod.com/t/visualizing-both-classic-loudness-x-time-and-spectrogram/22551/3 "2025-01-29T14:02:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [January 30, 2025, 12:02am UTC](https://qa.fmod.com/t/visualizing-both-classic-loudness-x-time-and-spectrogram/22551/4 "2025-01-30T00:02:49Z")

</div>

> [@fbpsound](#):
>
> I probably need to create a buffer for the data, right?

Yes, that is outlined in the Extracting PCM Data From a Sound:

```auto
buffer = new byte[(int)length];
sound.readData(buffer);

```

Don’t hesitate to reach out with anymore questions!
