Created
June 25, 2020 14:08
-
-
Save skratchdot/40a5dfe15822aeedde2f0503e7a11ff1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# create 1 second 440Hz sine wave | |
sox -n -c 1 -r 44100 sine.wav synth 1 sine 440 | |
# create 1 second of silence | |
sox -n -c 1 -r 44100 silence.wav trim 0 1 | |
# create 1 second 440Hz sine wave followed by 1 second of silence | |
sox -V sine.wav silence.wav output.wav | |
# output times followed by amplitudes | |
sox output.wav output.dat | |
# create spectrogram | |
sox output.wav -n spectrogram -o output-spectrogram.png | |
# create waveform | |
ffmpeg -i output.wav -filter_complex showwavespic -frames:v 1 output-waveform.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment