In iOS system settings, To adjust the volume balance, head to Settings > General > Accessibility. Here, you can adjust the left/right volume balance or set the audio to mono.
But can we do it in our app with our code ? objective-c or swift.
My app need play audio,video and virtual midi audio by 'Audio Unit', And I have try follow things:
- When I play audio,I can use pan property with AVAudioPlayer. It's work.
- When I play video with AVPlayer, Sorry. Here haven't pan property with AVPlayer. And I'm refused how to implement this.
When I play midi virtual audio by Audio Unit. I found related question in How to set pan in IOS Audio Unit Framework
AudioUnitParameterValue panValue = -1; // panned almost dead-right. possible values are between -1 and 1 int result = AudioUnitSetParameter(mixerUnit, kMultiChannelMixerParam_Pan, kAudioUnitScope_Input, 0, panValue, 0); if (result == 0) { NSLog("success"); }
I get success result,but right channel steal have audio output.
So I'm stuck in video and midi virtual audio part. How to set pan with the audio output? Any advice to me I'm so appreciate.