Re: AudioConverter Mono issue
Re: AudioConverter Mono issue
- Subject: Re: AudioConverter Mono issue
- From: Doug Wyatt <email@hidden>
- Date: Mon, 14 Jul 2003 12:36:03 -0700
The most likely explanation is that one or both of the
AudioStreamBasicDescriptions that you're passing to AudioConverterNew
is invalid... what are all the field values?
Doug
On Monday, July 14, 2003, at 4:09 AM, Benedict Singer wrote:
Greetings all,
First off, I just wanted to say that you all have done a great job with
the CoreAudio stuff; very useful and easy to use (although some C
documentation would be nice :-) ).
Anyway, the issue I have is when using an AudioConverter to convert the
PCM data I'm getting to the format for the output device (44.1 stereo).
The converter works wonderfully for doing other sample rates that are
stereo, but when I try and initialize a mono->stereo converter it
gives me
a format error (see output below). From the documentation and prior
traffic on this list I'm lead to believe that this should be possible,
so
I'm somewhat puzzled.
Debugging output:
entered init rt audio:
PCM values 0: 2
PCM values 1: 16
PCM values 2: 48000
Sample rate: 44100.000000
Channels: 2
SAMPLES_PER_PRE_BUFFER is: 2248
data size it wants for the buffer is: 8992
entered init rt audio:
PCM values 0: 1
PCM values 1: 16
PCM values 2: 48000
Sample rate: 44100.000000
Channels: 2
status: 1718449215, formaterr: 1718449215
Where the appropriate lines of code (snipped a bit) are:
status = AudioDeviceGetProperty( data->device, 0, isInput,
kAudioDevicePropertyStreamFormatMatch,
&inPropertyDataSize,
&description );
// change description according to requirements
descriptionActual = description;
description.mChannelsPerFrame = pcmValues[0];
description.mSampleRate = (double)pcmValues[2];
status = AudioConverterNew(&description, &descriptionActual,
&gConverter);
if (status) { fprintf(stderr, "status: %d, formaterr: %d", status,
kAudioConverterErr_FormatNotSupported); return 0; }
As you can see above, it happily makes me a converter when presented
with
stereo data, but refuses to do so for mono data.
Thanks!
Ben
_______________________________________________
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.