• 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
Problems when changing sample rate on a aggregate device (OSX 10.5.1)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems when changing sample rate on a aggregate device (OSX 10.5.1)


  • Subject: Problems when changing sample rate on a aggregate device (OSX 10.5.1)
  • From: Stéphane Letz <email@hidden>
  • Date: Mon, 3 Dec 2007 17:18:03 +0100

Hi,

We have code that use the AUHAL and possibly uses an aggregate device. We sometime want to change the sample rate of the aggregate device. We do that with the following code:

fDeviceID is the underling aggregate device, "samplerate" is the new wanted SR.

1)
// Check input sample rate
outSize = sizeof(AudioStreamBasicDescription);
err = AudioDeviceGetProperty(fDeviceID, 0, true, kAudioDevicePropertyStreamFormat, &outSize, &sampleRate);
if (err != noErr) {
.....
}

// Possibly change it
if (samplerate != (unsigned long)sampleRate.mSampleRate) {
sampleRate.mSampleRate = (Float64)samplerate;
err = AudioDeviceSetProperty(fDeviceID, NULL, 0, true, kAudioDevicePropertyStreamFormat, outSize, &sampleRate);
if (err != noErr) {
.....
}
}


2)
// Check ouput sample rate
outSize = sizeof(AudioStreamBasicDescription);
err = AudioDeviceGetProperty(fDeviceID, 0, false, kAudioDevicePropertyStreamFormat, &outSize, &sampleRate);
if (err != noErr) {
.....
}


// Possibly change it
if (samplerate != (unsigned long)sampleRate.mSampleRate) {
sampleRate.mSampleRate = (Float64)samplerate;
err = AudioDeviceSetProperty(fDeviceID, NULL, 0, false, kAudioDevicePropertyStreamFormat, outSize, &sampleRate);
if (err != noErr) {
.....
}
}


When actually changing the SR value, 1) succeed but 2) fails already in " Check ouput sample rate" part: we get an "kAudioHardwareUnknownPropertyError" error.

Is this a bug? Is this way of doing obsolete?

Thanks

Stephane Letz
_______________________________________________
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: Problems when changing sample rate on a aggregate device (OSX 10.5.1)
      • From: Jeff Moore <email@hidden>
  • Prev by Date: MusicPlayer Behavior
  • Next by Date: Re: Problems when changing sample rate on a aggregate device (OSX 10.5.1)
  • Previous by thread: MusicPlayer Behavior
  • Next by thread: Re: Problems when changing sample rate on a aggregate device (OSX 10.5.1)
  • Index(es):
    • Date
    • Thread