开发者

iPhone SDK: Panning audio at different levels

I am trying to control the channel (left/right) and its volume from which the audio file is played. It will be great if someone can explain how this can be done or point me to some docu开发者_开发技巧ment or tutorial which explains this.


If your source audio is monophonic, panning is done by reducing the volume in one of the left or right channels, so at center, they're both at 100%, and one channel is ramped down as you pan left or right.

If your source audio is stereophonic, then it's called "balance" and that's done the same way as panning, except that the two channels are kept separate instead of one channel being put into both left and right.

Volume can be controlled by multiplying each sample by a percentage.

But that's if you're reading and mixing audio at the sample level. If you're using one of the higher-level APIs there's usually a mixer unit or mixer controls where you set values for it and it does all that automatically.

Here's more low-level documentation on Core Audio:

http://developer.apple.com/Mac/library/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/AQuickTouroftheCoreAudioSDK/AQuickTouroftheCoreAudioSDK.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜