A blog by Devendra Tewari
Embedded developers have a frequent need to encode or decode PCM audio. In this post I show some GStreamer pipelines that can help with that task.
gst-launch-1.0 filesrc location=file.wav ! wavparse ! audioresample ! audioconvert ! audio/x-raw,format=S16BE,channels=1,rate=8000 ! filesink location=file.pcm
For additional raw formats, see Raw Audio Media Types.
For bulk conversion, try
find *.wav -exec gst-launch-1.0 filesrc location={} ! wavparse ! audioresample ! audioconvert ! audio/x-raw,format=S16BE,channels=1,rate=8000 ! filesink location={}.pcm \;
This should also work fine from Git Bash shell on Windows.
gst-launch-1.0 filesrc location=file.pcm ! audio/x-raw,format=S16BE,channels=1,rate=8000 ! audioconvert ! audio/x-raw,format=S16LE,channels=1,rate=8000 ! wavenc ! filesink location=file.wav
gst-launch-1.0 filesrc location=file.pcm ! audio/x-raw,format=S16BE,channels=1,rate=8000 !
audioconvert ! audioresample ! autoaudiosink
xxd -i file.pcm > voice.c