• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why Does Mono File Play as Stereo?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Why Does Mono File Play as Stereo?
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: Output Channel Selection Redux
  • Next by Date: does the AudioConverter implementation differ between tiger and leopard?
  • Previous by thread: Re: 16 bit audio
  • Next by thread: Re: Why Does Mono File Play as Stereo?
  • Index(es):
    • Date
    • Thread