How to play different music simultaneously from left and right earphones on iOS

Asked 2 years ago, Updated 2 years ago, 101 views

There is a request to play a different recorded sound source on the left and right at the same time.

After researching how to do this,
With OpenAL, you can set the position of the sound source.
I thought about installing one sound source to the right and the other to the left.
OpenAL did not seem to support audio playback such as mp3.

It seems that it is possible to convert mp3 into linear PCM.
Even if it's a short sound, you have to wait for about 15 minutes to convert the sound source. It's unrealistic.

Also, although you can fine-tune the location of OpenAL,
All you have to do this time is to make different sounds from the left and right
I'm looking for a simpler way.
(Isn't there such a way to play Core Audio?)

I would appreciate it if you could let me know if you have any better advice or advice.

ios swift objective-c

2022-09-30 21:16

1 Answers

I've never used it, but
I think the easiest way is to use AVAudioMixerNode on AVAudioEngine.
Shake the pan of the first input to the left and the pan of the second input to the right.

You can also use MixerNode on CoreAudio.


2022-09-30 21:16

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.