I was banging my head against a problem with a Audio Queue Services recorder until I noticed that while the programming guide uses AIFFs, the SpeakHere example uses CAF files. Switching to CAF got my example working.
But that got me wondering, so I changed SpeakHere to try to use AIFF instead of CAF. Specifically, I changed the URL references from "Recording.caf" to "Recording.aif", as well as changing the type in the audio file, as seen here (with a debug line to check and print the return value):
if (!self.audioFileID) { // create the audio file int myErr = AudioFileCreateWithURL ( audioFileURL, //kAudioFileCAFType, kAudioFileAIFFType, &audioFormat, kAudioFileFlags_EraseFile, &audioFileID ); NSLog (@"AudioFileCreateWithURL = %d", myErr); }
Sure enough, when I run it and try to record, I get
2/5/09 1:49:23 PM SpeakHere[17707] AudioFileCreateWithURL = 1718449215"
which is the "fmt?" (kAudioFormatUnsupportedDataFormatError) status code.
Should I just assume that recording PCM to AIFF doesn't work on iPhone? Not that I mind CAF, I just want to know.
Thanks.
--Chris
|