Why Does Mono File Play as Stereo?
Why Does Mono File Play as Stereo?
- Subject: Why Does Mono File Play as Stereo?
- From: Bob Ingraham <email@hidden>
- Date: Tue, 24 Feb 2009 17:23:31 -0700 (MST)
I have an mp3 file that was recorded mono (1 channel), 44.1kHz.
When I play it with the SimpleSDK/PlayFile demo, it plays on both left/right channels of the output device.
I tried modifying the PlayFile SimpleGraph() routine to modify the AUHAL output unit using the kAudioFilePropertyChannelLayout property, but it says that I am evil and I returns error -10851 (kAudioUnitErr_InvalidPropertyValue).
What am I doing wrong?
AudioChannelLayout chanLayout;
AUNode outputNode;
AudioUnit auOutput;
AUGraphAddNode (theGraph, &cd, &outputNode);
AUGraphOpen (theGraph);
AUGraphNodeInfo(theGraph, outputNode, &myCd, &auOutput);
// Set channel layout
memset(&chanLayout, 0, sizeof(chanLayout));
chanLayout.mChannelLayoutTag = kAudioChannelLayoutTag_UseChannelBitmap | kAudioChannelLayoutTag_Mono;
chanLayout.mChannelBitmap = kAudioChannelBit_Left;
err = AudioUnitSetProperty(auOutput, kAudioUnitProperty_AudioChannelLayout, kAudioUnitScope_Output, 1, &chanLayout, sizeof(chanLayout));
if (err != noErr)
{
printf("Failed to set Audio Channel Layout: %d\n", err);
}
Thanks,
Bob
_______________________________________________
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