72 4. ANALOG-TO-DIGITAL SIGNAL CONVERSION
Output Buffer
Audio Buffers
Recording
Callback
Ios Audio
Controller
Playback
Callback
Ios Audio
Controller
From Mic
LowPass
Filter in C
Input Buffer To Speaker
Figure L4.1: Audio signal dataflow.
e input samples can come from either a file or from the microphone input. ey get
stored as short arrays in an AudioBuffer. e i/o buffers are used to transfer data from the input
source to the processing code, and finally to the speaker as output. e use of callbacks allows
one to input data from either the microphone or a file, store them in a software buffer, process
them, and then output them to the speaker.
L4.1 APP SOURCE CODE
e project source of this app allows one to study sampling rate and frame size and their effects
on the maximum computation delay allowable in a real-time signal processing pipeline. It is
required to use a real iOS device for this app, as the simulator timings do not reflect those of an
actual target device.
is app performs signal sampling using the microphone of an iPhone smartphone. It can
also read in a CAF or PCM file format into the device storage. e input signal is accumulated
into frames of audio data and then passed to the C code for lowpass filtering. An artificial
computation delay is added to the filtering code using the function usleep within the C code
segment. e app settings menu allows adjusting the sampling rate, the frame size, and the
delay.
L4.2 APP CODE DISCUSSION
iOS does not require any permissions to be added to a manifest; it automatically asks the user
for permission to access the microphone. As the audio file provided for testing with this app is
included in the main bundle, no special permissions are required to access it.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.179.119