Im using this ffmpeg command to convert mp3 to wav:
ffmpeg -i audio.mp3 -acodec libmp3lame -ab 64k -ar 16000 audio.wav
and this command to create waveform from audio.wav:
wav2png --foreground-color=ffb400aa --background-color=2e4562ff -o example4.png papa2.wav
I would love to know, how to run this commands multiple? For example, when conversion from .mp3 to .wav is done, then run the wav2png command.
Thank You!
You have several options here:
Option 1: Use
&&
In Bash you can use an and list to concatenate commands. Each command will be executed one after the other. The and list will terminate when a command fails, or when all commands have been successfully executed.
Using
-acodec libmp3lame
when outputting to WAV makes no sense, so I removed that.WAV ignores bitrate options, so I removed
-ab
.Do you really need to change the audio rate (
-ar
)? Removed.Option 2: Pipe from
ffmpeg
towav2png
Instead of making a temporary WAV file you can pipe the output from
ffmpeg
directly towav2png
:Option 3: Just use
ffmpeg
Saving the best for last, you can try the showwavespic filter.
ffmpeg
.