1
2

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.

Shell ScriptAdvent Calendar 2018

Day 4

シェルでFFTする

Last updated at Posted at 2018-12-23

とりあえずメモ書きだけしておく。

ffmpeg -t 1 -f avfoundation -i ":0" -f flac - | sox - -n stat -freq 2> fft.txt
time (cat fft.txt | awk 'BEGIN{sum=0} {sum += $2} END{print sum}')
time (cat fft.txt | awk 'BEGIN{sum=0} {if(NR % 2048 == 0){print sum/2048; sum = 0} else{sum += $2}}')
ffmpeg -f avfoundation -i ":0" -f flac - 2>/dev/null | sox - -n stat -freq 2>&1 | awk 'BEGIN{sum=0} {if(NR % 2048 == 0){print sum/2048; sum = 0} else{sum += $2}}'

参考: https://qiita.com/ina111/items/6d9e9dcea275213cb431

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?