Audio Manipulation / DTO


#1

Hello

I need to be able to hold audio channels in memory and to convert from the original format to some other formats.

In my POC I’m using MemoryBlock but its just a too low-level DTO to store this information.

I think it needs to be something like AudioSampleBuffer, with samples and channels, and be format-agnostic but though I went over the API again and again I can’t figure it out.

I can switch from AudioFormatReader to AudioSampleBuffer using AudioFormatReader::read() but how can I go the other way? how can I switch from

an AudioSampleBuffer to AudioFormatReader?


#2

You’d have to write a custom AudioFormatReader, which would be very easy to do.

But the idea of holding it all in memory seems a bit odd to me, and is rarely how you do this kind of thing. In general you’d work a block at a time with a reader and a writer to do conversions.


#3

You are right, I probably should keep the AudioFormatReaders as the content holders.

Thanks Jules