# Get sound file data

**URL:** <https://qa.fmod.com/t/get-sound-file-data/17505>\
**Category:** Unity\
**Tags:** unity\
**Created:** [August 1, 2021, 2:03am UTC](https://qa.fmod.com/t/get-sound-file-data/17505 "2021-08-01T02:03:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danielkotzer](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@Danielkotzer](https://qa.fmod.com/u/Danielkotzer)\
**Post date:** [August 1, 2021, 2:03am UTC](https://qa.fmod.com/t/get-sound-file-data/17505/1 "2021-08-01T02:03:46Z")

</div>

it is so simple getting the audio data in unity: audioSource.clip.GetData(samples, 0);  
I’m trying to do the same with Fmod, seems to be a mission impossible.  
My sound object is created in real time by recording one second in a loop.

```auto
RuntimeManager.CoreSystem.recordStart(RecordingDeviceIndex, sound, true);

```

How can I get the data?  
If it is so complicated, maybe I can simply convert the sound object into an AudioClip in unity, and deal with it in the simple way. Don’t know what to do.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [August 5, 2021, 6:06am UTC](https://qa.fmod.com/t/get-sound-file-data/17505/2 "2021-08-05T06:06:48Z")

</div>

I’m not entirely certain what the Unity `GetData` function is for, but you should be able to get the data you need either by using `readData` or the `lock` functions on a sound.

[https://www.fmod.com/resources/documentation-api?version=2.02&page=core-api-sound.html#sound\_readdata](https://www.fmod.com/resources/documentation-api?version=2.02&page=core-api-sound.html#sound_readdata)

[https://www.fmod.com/resources/documentation-api?version=2.02&page=core-api-sound.html#sound\_lock](https://www.fmod.com/resources/documentation-api?version=2.02&page=core-api-sound.html#sound_lock)
