user505593
user505593

Reputation: 159

How to configure left channel and right channel separately in AudioUnit or OpenAL

I am generating sine wave tones with two different frequency(say 440hz and 445hz). I need to play this tones in left channel and right channel respectively.I am successful in playing this tone using Audio Queue. Audio queue dose not provide any option(any predefined function to change pitch) to change pitch of these tones. So, i tried using Audio unit and OpenlAL but i have issues in playing sound in left and right channel separately. Can any one help me on this issue.

All i have to do is to play these tones in left and right channels separately, with option to change pitch of these tones.

Note:Sine wave tone is generated on the fly, no audio files are used.

Upvotes: 1

Views: 2124

Answers (1)

P i
P i

Reputation: 30674

This should be pretty easy. what have you tried? Where are you stuck? or do you just want someone to do it for you? Show code...

Have you actually read the audio units programming guide? Sounds like you haven't, so you need to do that first. That would answer your question.

Then you could start with something like this: http://cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html

You just need to configure your ABSDs ( if I got that acronym right ... audio buffer stream descriptors... ie the structure that tells your various core audio objects what format you are using ).

So you will want to set those to stereo.

Then when you fill up the buffers in your render callback make sure you're filling up for both channels.

Upvotes: 2

Related Questions