LoginSignup
14
12

More than 5 years have passed since last update.

Pydub を使って、WAVファイルの合成をしてみた。

Last updated at Posted at 2015-02-05

Pydub (http://pydub.com/) とかいう音楽データを簡単に操作できるライブラリを見つけたので、
WAVファイルを合成して遊んでみた。

ffmpeg か avconv を入れつつ、 pip install pydub でインストール。

ソースコードはこんな感じ

#!/usr/bin/env python2.7
#-*- coding: utf-8 -*-

from pydub import AudioSegment

sound1 = AudioSegment.from_wav("path to wav file 1")
sound2 = AudioSegment.from_wav("path to wav file 2")
sound3 = AudioSegment.from_wav("path to wav file 3")

combined_sounds = sound1 + sound2 + sound3
combined_sounds.export("path to save path/combined_sounds.wav", format="wav")

14
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
12