Is anyone out there using an 8 kHz simulator at the AudioUnit level?
IPhone simulator sound works only for frequencies 44100 Hz, 22050 Hz and 11025 Hz. Otherwise, it can happen strangely.
I'm having trouble recording sound in the iPhone simulator. The code works fine on the hard drive, but the simulator is not so strange.
I am working on the AudioUnit level, and I set the sampling rate (using the properties of the audio session) to 8000 Hz. Works great on the hardware level, but on the simulator, the render callback requests one block of data of the appropriate size, and then forwards every 11.6 ms, requesting one byte.
I tried to set the sampling rate to 44100/4 (11025 Hz), and it worked fine. Therefore, I tried to set the sampling rate of audio recordings to 11024 and broke. The same with 11026. 11025 works.
My assumption is that there is an error in the sound code of the simulator. I think that inside it should have a buffer that is a quarter of a second, and it cannot handle situations where the sampling frequency is not a multiple of something.
Can anyone try this in their own simulator code? Try sampling rates of 11024, 11025, and 11026 and see if only 11025 works?
UPDATE: if I ask for 11024, it gives me 8000, but the render callback continues to deliver ioData with only one frame request (1 byte). Same behavior when I ask for 8000 Hz.
UPDATE2: The simulator also works when I program at the AudioQueue API level. It processes 8 kHz. It looks like this is similar to the AudioUnit API level.