Created
May 25, 2017 00:48
-
-
Save batoreh/e39ac0abf75ffee2e5696ce7afb4ec9f to your computer and use it in GitHub Desktop.
This file contains 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 os import listdir, getcwd | |
from pydub import AudioSegment | |
import re | |
def reverse_audio_files(audio_file): | |
audio = AudioSegment.from_wav(audio_file) | |
return audio.reverse() | |
cwd = getcwd() | |
dirlist = listdir(cwd); | |
wav_files = map(reverse_audio_files, filter(lambda file: file.endswith('.wav'), dirlist)) | |
for index, audio in enumerate(wav_files): | |
audio.export('exported %s.mp3' % index, format="mp3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment