Created
March 20, 2015 23:00
-
-
Save srikarg/7bf2862f83096a36d394 to your computer and use it in GitHub Desktop.
This is an example of combining a folder of songs into one mp3 file using pydub (http://pydub.com/).
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
import os | |
from glob import glob | |
from pydub import AudioSegment | |
AudioSegment.converter = '/usr/local/bin/ffmpeg' | |
playlist_songs = [AudioSegment.from_mp3(file) for file in glob('songs/*.mp3')] | |
combined = AudioSegment.empty() | |
for song in playlist_songs: | |
combined += song | |
combined.export('combined.mp3', format='mp3') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment