Chapter 2 - ProcessAudioFrame() | FX Book Questions | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Chapter 2 - ProcessAudioFrame()
April 4, 2018 - 5:51 am
Member Since: April 2, 2018
Forum Posts: 9
sp_UserOfflineSmall Offline

The ProcessAudioFrame() function consists of pInputBuffer and pOutputBuffer. Each one of these is a frame consisting of channel Left and Channel Right data.

But is this data (per channel) a single float value or a buffer (say 512 byte) long of samples?


I'm a bit lost with understanding this. The Audio interface supplies the OS and RackAFX a buffer of (say) 512 bytes. Is this broken into sample by sample calculations in the RackAFX modules? Or elsewhere?


A command line like this:

pOutputBuffer[0] = 0.5 * pInputBuffer[0];


Does it multiply by 0.5 a single sample each iteration of a batch of samples (say 512 bytes) ?

April 4, 2018 - 8:50 am
Member Since: January 29, 2017
Forum Posts: 693
sp_UserOfflineSmall Offline

The left and right input/output buffers consist of individual samples from each channel. The actual population of those little two-slot arrays is determined by the channel count variables that are passed into the function. For processAudioFrame:

pOutputBuffer[0] = 0.5 * pInputBuffer[0];

would scale the left input channel sample by 0.5 and write it the left output channel.

If you want to process buffers rather than frames, there are multiple functions that do this and there is a Forum topic here:

- Will

April 4, 2018 - 2:53 pm
Member Since: April 2, 2018
Forum Posts: 9
sp_UserOfflineSmall Offline

Thanks Will. Understood.


The book is amazing, it explains really well and I'm enjoying it very much.

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 56

Skyler: 48

StevieD: 46

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

Nickolai: 43

clau_ste: 39

jeanlecode: 37

Member Stats:

Guest Posters: 2

Members: 782

Moderators: 1

Admins: 6

Forum Stats:

Groups: 13

Forums: 42

Topics: 849

Posts: 3370

Moderators: W Pirkle: 693