Created
December 8, 2019 15:02
-
-
Save rah003/ed136ecda2985b5d8a6dc3691201e9a2 to your computer and use it in GitHub Desktop.
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
import os | |
from pydub import AudioSegment | |
# main body | |
folder_path = "audio-samples" | |
for filename in os.listdir(folder_path): | |
sound = AudioSegment.from_wav(os.path.join(folder_path,filename)) | |
sound = sound.set_channels(1) | |
sound.export(os.path.join(folder_path+ "-mono","mono_"+filename), format="wav", bitrate="16k") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment