Low Latency Audio on iPhone
I’ve been meaning to post about this for a while now. I’ve successfully achieved super low latency audio on the iPhone. The app is using RemoteIO, which is a super-duper-under-documented audio unit. Much of my success is due to Mike, and his blog is here. It’s running at about 5 milliseconds latency right now to allow for a more accurate fast fourier transform (although you can set a smaller size in my code). Right now it has a gain slider, a mute switch, and a ‘Write to Console’ button. The button prints all of the PCM values into the console for one instance of the audio callback. I’ve been taking that data and feeding it into MATLAB to make sure things are working properly. Check out this page to see what my MATLAB verifications look like. As mentioned above, FFT is working and I am performing a rudimentary frequency analysis. I am getting pitch detection with a resolution of 43 Hz because of the 5ms buffer and 44.1kHz sampling rate. Obviously that isn’t good enough for an application like a tuner, but the code could be adjusted. I’ve made the code open source and you can view the project on Google Code here. My next goal is to implement a very simple delay line and then start networking devices.