Hi,
I am having a problem playing files with 22 kHz sample rate using this code here. I get this
(OSStatus) 560226676
for err if the sample rate is not 44 kHz. I'm not sure how to get Xcode to tell me what that error is. Somehow the command clicking for the CoreAudio stuff isn't working in my project. (For example, I can't select AudioDeviceSetProperty and command click it and find the definition, etc.)
audio_data.format.mSampleRate = audio_data.sfinfo.samplerate ;
audio_data.format.mChannelsPerFrame = audio_data.sfinfo.channels ;
rate = (int *) &(audio_data.format.mSampleRate);
channels = (int *) &(audio_data.format.mChannelsPerFrame);
//Set the sample rate.
if ((err = AudioDeviceSetProperty (audio_data.device, NULL, 0, false, kAudioDevicePropertyStreamFormat,
sizeof (AudioStreamBasicDescription), &(audio_data.format))) != noErr)
{ printf ("AudioDeviceSetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ;
return -1;
} ;
Any tips or hints would be very welcome!