Float buffers from APIs are fast to read, aren't they?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

iOS can give me a buffer of floats where I'm supposed to write the sound. Am I supposed to do mixing (reading) in there too? I do that and it seems to be fast (I haven't compared it to mixing in other memory). Can I safely assume that it won't be slow on some other Apple hardware? I mean.. "video memory" is slow to read, but sound memory isn't, right?

Post

The memory it gives you is just like any other. There is nothing special about it.

You might want to be concerned about whether it is aligned but it most likely already is.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

markussomething wrote:iOS can give me a buffer of floats where I'm supposed to write the sound. Am I supposed to do mixing (reading) in there too? I do that and it seems to be fast (I haven't compared it to mixing in other memory). Can I safely assume that it won't be slow on some other Apple hardware? I mean.. "video memory" is slow to read, but sound memory isn't, right?
You shouldn't do mixing - you should just overwrite what was there before.

The sound buffer you write to is in ordinary RAM, it's not a memory map to some strange device memory across a slow bus, and I'm pretty sure it's not involved in any DMA as well. In fact, iOS will usually do some more conversions on the buffer contents after your callback returns anyways - sample rate conversion if it's not 44khz, volume+mixing with other programs, final conversion to 16bits...

Post

Ok, then my code should be fine.

Thanks a lot for the replies. :)

Post Reply

Return to “DSP and Plugin Development”