Can I read audio sample data somehow?

,

I am using UE5 and I need audio sample data as something like Array < uint8 >. Is there any way to get this kind of data in via fmod event? I couldn’t find any kind of Read function.

I don’t need this data in runtime. I only need it in editor btw.

You can get the audio sample data from a sound using Sound::readData. We have an example of how to use this method here: Reading Sound Data
Getting the sound from an event requires an additional step- the sound data only becomes available when an event needs to play it, so you will need to play the event and use an Event Callback to read the sound data when it begins playing:

FMOD_RESULT F_CALLBACK Callback(FMOD_STUDIO_EVENT_CALLBACK_TYPE type,  FMOD_STUDIO_EVENTINSTANCE* event,  void* parameters)
{
    switch(type)
    {
        case FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED:
        {
            FMOD::Sound* sound = (FMOD::Sound*)parameters;
            unsigned int length;
            char* buffer;

            sound->getLength(&length, FMOD_TIMEUNIT_RAWBYTES);
            buffer = new char[length];
            sound->readData(buffer, length, nullptr);

            // Do something with the data

            delete[] buffer;
            break;
        }
    }
    return FMOD_OK;
}