Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate Spectrogram with SoX

Tags:

sox

I'm trying to generate a spectrogram using the SoX program. According to the documentation, I should try the following to create a spectrogram:

sox output.wav -n spectrogram

Instead of a spectrogram I get the following error:

sox FAIL formats: can't determine type of `spectrogram'

I'm running Ubuntu 12.04.

like image 918
Boedy Avatar asked Jul 19 '26 04:07

Boedy


2 Answers

I know why it happened. You copied this text-command from documentation http://sox.sourceforge.net/sox.html So, if you type manually it will work fine. Some symbols in documentation are in incorrect charset for you

like image 79
Dima Melnik Avatar answered Jul 22 '26 23:07

Dima Melnik


To amplify Dima Melnik's answer, the online manual has substituted Unicode characters where ASCII is expected. If you copy the spectrogram example verbatim, the -n (bytes \x2d \x6e) you think you're typing are actually −n (bytes \xe2 \x88 \x92 \x6e, first character U+2212 MINUS SIGN in UTF-8). sox is trying to parse−n as a file name, and is getting confused.

like image 26
scruss Avatar answered Jul 23 '26 00:07

scruss