LoginSignup
22
22

More than 5 years have passed since last update.

コマンドラインから耳栓をつくる

Posted at

soxというソフトウェアを使用します

$ sox -t sl -r 44100 -c 2 /dev/zero -r 44100 -c 2 \
     mimisen10.mp3 synth 10:00 \
     whitenoise vol 0.5

これで10分間ノイズが鳴るだけの音楽ファイルが生成されます。

イヤホンで聞いてれば周りの音はだいぶ聞こえなくなります。大変便利です。
こういうことを書くとヒドい人間とか言われそうですが、具体的にはバスの中で赤ちゃんが全然泣き止んでくれない場合に大変便利です。もちろん普通に作業中に3回リピート設定にしたりしてもいいと思います。

ちなみにsoxのインストールはbrewで出来ました。

$ brew install sox

mp3で音声ファイルを書き出したい場合はlameを入れてからインストールです。

$ brew install lame
$ brew install sox
22
22
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
22
22