I'm having a strange iPhoneOS problem, I'll post it here to see if anyone has any clues. I load a soundfile into a buffer:
status = AudioFileReadPackets (soundFile, false, &numBytes, NULL, 0, &numPackets, sampBuf);
if (status !=0) {
NSLog(@"problem reading file packets into buffer");
return -1;
}
and in the simulator it works fine and dandy to access and play the buffer. However, when I compile and load into my iPhone device, I hear nothing... no errors reported though.
Now, if I add this line after the above code:
NSLog(@"numPackets read into sampBuf: %d", numPackets);
it then works fine on my device! Nothing else is changed in the code. Is this at all familiar to anyone?
brad