• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat


  • Subject: Re: AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat
  • From: Jeff Moore <email@hidden>
  • Date: Tue, 1 Mar 2005 17:52:41 -0800

That error is kAudioDeviceUnsupportedFormatError. It means the device doesn't support the format you want to use.

BTW, you should be using kAudioDevicePropertyNominalSampleRate if all you want to do is change the sample rate. If you want to  change more than that, you need to write your code such that it deals with format info at the AudioStream level, rather than the AudioDevice level.

On Mar 1, 2005, at 5:43 PM, Rob Frohne wrote:

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!



--

Jeff Moore
Core Audio
Apple


 _______________________________________________
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

  • Follow-Ups:
    • Re: AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat
      • From: Rob Frohne <email@hidden>
References: 
 >AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat (From: Rob Frohne <email@hidden>)

  • Prev by Date: AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat
  • Next by Date: Sound Input Component
  • Previous by thread: AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat
  • Next by thread: Re: AudioDeviceSetProperty and setting kAudioDevicePropertyStreamFormat
  • Index(es):
    • Date
    • Thread