Skip to content

Instantly share code, notes, and snippets.

@staybuzz
Created January 3, 2016 15:45
Show Gist options
  • Save staybuzz/5bccc0db55aa9eac0734 to your computer and use it in GitHub Desktop.
Save staybuzz/5bccc0db55aa9eac0734 to your computer and use it in GitHub Desktop.
#coding: utf-8
"""
requirement:
ffmpeg
usage example:
$ ls *.mp3 | python mp32wav.py
input: test.mp3
output: test.wav
"""
from pydub import AudioSegment
import sys
argvs = sys.argv
argc = len(argvs)
files = sys.stdin.read().splitlines()
for snd in files:
sound = AudioSegment.from_mp3(snd)
sound.export(snd.split(".")[0] + ".wav", format="wav").close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment