Re: (HAL) pather format matching, bug or feature?
Re: (HAL) pather format matching, bug or feature?
- Subject: Re: (HAL) pather format matching, bug or feature?
- From: Michael Thornburgh <email@hidden>
- Date: Fri, 18 Jul 2003 13:19:36 -0700
the following code, on a jaguar system with an imic as the default
output device, prints
found 2 formats
trying a 0
trying a 0
and on a panther system (my bronze g3 powerbook, pb101, no firewire)
with an imic attached and set as the default output device, prints
found 2 formats
trying a 0
match changed 44100.0 to 0.0
trying a 0
match changed 44100.0 to 0.0
similar results are obtained going through the stream interface, for
both logical and physical format matches.
---
#include <stdio.h>
#include <stdlib.h>
#include <CoreAudio/CoreAudio.h>
main()
{
AudioDeviceID outputID;
OSStatus theStatus;
UInt32 theSize;
AudioStreamBasicDescription * descriptionArray;
UInt32 numDescriptions;
int x;
theSize = sizeof(AudioDeviceID);
theStatus = AudioHardwareGetProperty (
kAudioHardwarePropertyDefaultOutputDevice, &theSize, &outputID );
if ( noErr != theStatus )
return -1;
theStatus = AudioDeviceGetPropertyInfo ( outputID, 0, 0,
kAudioDevicePropertyStreamFormats, &theSize, NULL );
if ( noErr != theStatus )
return -1;
numDescriptions = theSize / sizeof(AudioStreamBasicDescription);
descriptionArray = malloc ( theSize );
theStatus = AudioDeviceGetProperty ( outputID, 0, 0,
kAudioDevicePropertyStreamFormats, &theSize, descriptionArray );
if ( noErr != theStatus )
return -1;
printf ( "found %u formats\n", numDescriptions );
for ( x = 0; x < numDescriptions; x++ )
{
if ( 0.0 == descriptionArray[x].mSampleRate )
{
printf ( "trying a 0\n" );
descriptionArray[x].mSampleRate = 44100.0;
theSize = sizeof(AudioStreamBasicDescription);
theStatus = AudioDeviceGetProperty ( outputID, 0, 0,
kAudioDevicePropertyStreamFormatMatch, &theSize, &descriptionArray[x] );
if ( noErr == theStatus )
{
if ( 0.0 == descriptionArray[x].mSampleRate )
{
printf ( "match changed 44100.0 to 0.0\n" );
}
}
}
}
return 0;
}
---
-mike
On Friday, July 18, 2003, at 11:32 AM, Jeff Moore wrote:
Can you provid an example that illustrates the problem? Sounds like a
bug.
On Thursday, July 17, 2003, at 8:25 PM, Michael Thornburgh wrote:
so on the panther preview, i've noticed that the
kAudioDevicePropertyStreamFormatMatch and
kAudioStreamPropertyPhysicalFormatMatch properties, on a USB audio
device (griffin imic) that shows "0 Hz" on the output side
(indicating a range of sample rates are available), will set a
non-zero (and supported) sample rate to zero in the stream format and
then return with noErr. this behavior is different than in jaguar,
where the sample rate would be left unchanged.
is this behavior (zeroing the sample rate) on a
kAudioDevicePropertyStreamFormatMatch or
kAudioStreamPropertyPhysicalFormatMatch intended?
-mike
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.