AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat
AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat
- Subject: AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat
- From: Rob Frohne <email@hidden>
- Date: Tue, 1 Mar 2005 17:43:36 -0800
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!
Thanks,
Rob
--
Rob Frohne, Ph.D., P.E.
E.F. Cross School of Engineering
Walla Walla College
http://www.wwc.edu/~frohro/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden