Re: Audio Device Property Caching in Snow Leopard?
Re: Audio Device Property Caching in Snow Leopard?
- Subject: Re: Audio Device Property Caching in Snow Leopard?
- From: AI Developer <email@hidden>
- Date: Fri, 23 Oct 2009 19:05:52 +0530
I've still not been able to get a handle on this problem, but I had a
thought, perhaps someone can help me on this:
Is it possible that the GetProperty will not reflect the change until
the SR change notification is handled by the HAL's notification
handler. And if the notification handler's run loop source has been
added only to the primary thread (which is also making this call), the
state will not get updated until the notification handler gets a chance
to do it's work?
Thanks.
Devendra.
AI Developer wrote:
Hi,
Does Snow Leopard cache audio device properties, and satisfy calls from
the cache?
I've run into a very wierd problem when trying to change the Sampling
Rate of a device on SR.
If I set the SR, and then query the SR back, I do not get the new value
- ever, as long as the application instance is running!
Here's some sample code that demonstrates the problem:
-------
err = AudioDeviceSetProperty(currentID,
NULL,
0, 0,
kAudioDevicePropertyNominalSampleRate, propSize, &srToSet);
if (err == kAudioHardwareNoError)
{
Float64 currentSR = 0.0;
propSize = sizeof (currentSR);
err = AudioDeviceGetProperty(currentID, 0, 0,
kAudioDevicePropertyNominalSampleRate, &propSize, ¤tSR);
if (err == kAudioHardwareNoError)
{
std::cout << "\tResultant Nominal Sampling Rate: "
<< (int)currentSR << " Hz.";
}
}
-------
If srToSet is differet from the current rate, and I execute this code,
the value coming out of the GetProperty is not as expected.
Note that at the same time, the SR has been changed properly (Audio
MIDI Setup shows the new value as soon as the SetProperty succeeds).
It's just that the process that has invoked the SetProperty shows the
wrong value.
This only happens on 10.6, not on 10.5.
Am I doing something wrong here?
Thanks.
Devendra.
|
_______________________________________________
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