kAudioDevicePropertyStreamFormat in AudioStreamSetProperty fails
kAudioDevicePropertyStreamFormat in AudioStreamSetProperty fails
- Subject: kAudioDevicePropertyStreamFormat in AudioStreamSetProperty fails
- From: Michael Thornburgh <email@hidden>
- Date: Wed, 4 Sep 2002 10:09:40 -0700
this is mostly directed at the apple folks on the list -- i'd like to
know if the following is an on-purpose behavior change, or a bug that
i should report.
in 10.2, if i attempt to set the logical stream format of a stream
(kAudioDevicePropertyStreamFormat), the AudioStreamSetProperty call
will fail with "!siz". here is the code in question:
- (Boolean) setStreamDescription:(MTCoreAudioStreamDescription
*)theDescription forSide:(MTCoreAudioStreamSide)theSide
{
OSStatus theStatus;
UInt32 theSize;
AudioStreamBasicDescription theASBasicDescription;
UInt32 theProperty;
if (theSide == kMTCoreAudioStreamPhysicalSide)
theProperty = kAudioStreamPropertyPhysicalFormat;
else
theProperty = kAudioDevicePropertyStreamFormat;
theASBasicDescription = [theDescription
audioStreamBasicDescription];
theSize = sizeof(AudioStreamBasicDescription);
theStatus = AudioStreamSetProperty ( myStream, NULL, 0,
theProperty, theSize, &theASBasicDescription );
if (theStatus != 0)
printf ("MTCoreAudioStream setStreamDescription:forSide: failed,
got %4.4s\n", (char *)&theStatus );
return (theStatus == 0);
}
so, this will fail with !siz if theProperty is
kAudioDevicePropertyStreamFormat, but
will succeed if it is kAudioStreamPropertyPhysicalFormat.
attempting to set the logical stream format using
AudioDeviceSetProperty for a
channel and direction corresponding to the stream in question does
work, however,
using the very same AudioStreamBasicDescription passed to
AudioStreamSetProperty.
this feels like a bug (especially since it worked in 10.1) -- it seems
like
if i'm not allowed to set the logical format for the stream, i should
get back a different error than "sizeof(AudioStreamBasicDescription) is
the wrong size for an AudioStreamBasicDescription". :)
is this a bug, or is this on purpose? is there now a different
preferred way
to set the logical stream format?
-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.