Avatar

Please consider registering
guest

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()
Avatar
Malcolm rest
Member
Members
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) ?

Avatar
W Pirkle
Admin
April 4, 2018 - 8:50 am
Member Since: January 29, 2017
Forum Posts: 344
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:

http://www.willpirkle.com/forum/using-rackafxrackafx-projects/diffrences-of-processaudio-methods/

- Will

Avatar
Malcolm rest
Member
Members
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: 55

Currently Online:
10 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 45

Peter: 41

clau_ste: 39

TheSmile: 37

JimmyM: 33

Gwen: 32

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 565

Moderators: 1

Admins: 4

Forum Stats:

Groups: 12

Forums: 36

Topics: 581

Posts: 2326

Newest Members:

frankthetank, dhodgson, Wanderer, mister1234, Evan Galvanek, Rowan Fraser, patrickbarr1984, Ray C., Jon R., Pat

Moderators: W Pirkle: 344

Administrators: Tom: 69, JD Young: 80, Will Pirkle: 0, W Pirkle: 344