I wrote this code with pydub
. I want to make to different variables with the same song.
One song would just play in the left ear and one song would just play in the right ear.
from pydub import AudioSegment
src = "or_test.mp3"
dst1 = "mono_left.mp3"
dst2 = "mono_right.mp3" # enter code here
sound1 = AudioSegment.from_mp3(src)
sound2 = AudioSegment.from_mp3(src)
mono_audios1 = sound1.split_to_mono()
mono_audios2 = sound2.split_to_mono()
mono_left = mono_audios1[1].export(dst1, format="mp3")
mono_right = mono_audios1[0].export(dst2, format="mp3")
When I run mono_right
or mono_left
the sound plays from both ears, but I don't want it like that.
How do I correct this?