8
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

フォルダ内のwavファイルを一括でmp3に変更

Posted at

やりたかったことは

  • コマンドライン上でwavをmp3に変換
  • フォルダ内の全ファイルに一括でコマンド適用(シェルのお勉強)

wav to mp3

ffmpegをインストール

$brew install ffmpeg

変換

ffmpeg -i "hoge.wav" -vn -ac 2 -ar 44100 -ab 256k -acodec libmp3lame -f mp3 "hoge.mp3"

-abでビットレートを指定します。

一括処理

for i in $(ls)
do
ffmpeg -i $i -vn -ac 2 -ar 44100 -ab 256k -acodec libmp3lame -f mp3 ${i%.*}.mp3
done
8
11
2

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
8
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?