• 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
Re: panning with Audio Queue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: panning with Audio Queue


  • Subject: Re: panning with Audio Queue
  • From: William Stewart <email@hidden>
  • Date: Mon, 26 Oct 2009 15:00:09 -0700


On Oct 26, 2009, at 12:13 PM, Matthew Pease wrote:

I suppose if I use ExtendedAudioFile to decode to PCM, then I could
just copy bytes from one channel to the other to have the effect of
panning.

But I thought that if I used ExtendedAudioFile that would greatly
increase the battery drain of my app because MP3 isn't being decoded
by specialized hardware.

yes. The alternative is less attractive - you use and AQ in offline render mode - it will use h/w to decode for you, and you get back the decoded data. Then you can use another queue to play it - say doing your own panning (If you go from stereo to mono you should multiple each sample by 0.7071 as this will avoid clipping


you can also write a bug for us so that we will know to add something for a future release

Thanks

Bill


Best - Matt

On Mon, Oct 26, 2009 at 11:15 AM, William Stewart <email@hidden> wrote:

On Oct 24, 2009, at 2:25 PM, Matthew Pease wrote:

Hello  -

 I am using Audio Queue with File Streams to do streaming MP3s on
the iPhone. (using

 What I'd like to add now is hard panning.   The audio is one voice
in left channel, another in the right channel.     What you get is
people talking over each other -- not good.


I tried just copying bytes in the stream from left-> right channel (assuming interleaved bytes). But then I realized the data must be encoded MP3s.


So then I looked at Audio Units -- the panning unit or the 3d mixer
looks promising. However, it is unclear to me: Is their an Audio
Unit chain that already exists where I could just modify the 3dMixer's
values? Or must I wire up my own Audio Unit graph and handle
writing bytes from the stream to it (replacing my AudioQueue code)?



Any tips on how to add panning to an http MP3 stream would be very high appreciated!

AQ doesn't support panning of its audio. OpenAL is probably your best
approach I think - you can use ExtendedAudioFile to read the data and decode
to a linear PCM buffer, then you attach that to an OpenAL source and pan
that however you want.


You could also set up your own audio unit mixer, etc, but then you have more
work to do as you need to manage a read thread, etc.


Bill


Thank you! Matt _______________________________________________ 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



_______________________________________________ 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
References: 
 >panning with Audio Queue (From: Matthew Pease <email@hidden>)
 >Re: panning with Audio Queue (From: William Stewart <email@hidden>)
 >Re: panning with Audio Queue (From: Matthew Pease <email@hidden>)

  • Prev by Date: Re: CAPlayThrough crashes
  • Next by Date: Re: CAPlayThrough crashes
  • Previous by thread: Re: panning with Audio Queue
  • Next by thread: CAPlayThrough crashes
  • Index(es):
    • Date
    • Thread