Created
July 16, 2022 07:44
-
-
Save Dobby233Liu/02e9e4f75a543df1a3a3e3087052213d to your computer and use it in GitHub Desktop.
true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydub import AudioSegment | |
org = input("org file : ") | |
out = input("out file : ") | |
aud = AudioSegment.from_file(org) | |
channels = aud.split_to_mono() | |
for i in range(0, len(channels), 2): | |
l_sub_r = channels[i].overlay(channels[i + 1].invert_phase()) | |
r_sub_l = channels[i + 1].overlay(channels[i].invert_phase()) | |
channels[i], channels[i + 1] = l_sub_r, r_sub_l | |
aud = AudioSegment.from_mono_audiosegments(*channels) | |
aud.normalize() | |
aud.export(out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment