alexbw / novocaine

Painless high-performance audio on iOS and Mac OS X
http://alexbw.github.com/novocaine/
MIT License
2.23k stars 273 forks source link

What exactly comes from the newAudio variable? #122

Closed KatkayApps closed 8 years ago

KatkayApps commented 8 years ago

Two fast questions:

When you put this code

[audioManager setInputBlock:^(float *newAudio, UInt32 numSamples, UInt32 numChannels) { // Now you're getting audio from the microphone every 20 milliseconds or so. How's that for easy? // Audio comes in interleaved, so, // if numChannels = 2, newAudio[0] is channel 1, newAudio[1] is channel 2, newAudio[2] is channel 1, etc. }];

1) what exactly comes from *newAudio? the audio level from 0 to 1? 2) why do you say it will read the microphone every 20 milliseconds? are you talking about audio samples? It cannot be or you would only be able to record waves up to 50 Hz...

Care to explain? thanks.