I have successfully been running this AVAudioRecorder example through a regular XCode based project. I would like to record from a daemon application running on a jailbroken device and tried to implement the same functionality from a simple command line app.
In my simple test, I start the recording from main and sleep for a few seconds before stopping the recording. The result is always the same: A truncated .caf file of size 4096 bytes (looks like a correct header and null data). It doesn't make any difference if I initiate the recording from a separately spawned thread. I tried both record()
and recordForDuration()
.
All methods invoked return an OK result. If I invoke recording()
on the AVAudioRecorder instance, it returns YES while recording.
Do I miss some fundamental initialization that a regular XCode based GUI app takes care of behind the scenes?