Archive for the ‘audio’ Category

Normally all audio pipelines use an audio codec and RTP encapsulation. I searched a lot for a raw audio pipeline, but I could not find much information. Then, I tried different options and came up with the following.

gst-launch-1.0 -v filesrc location=/tmp/musicfile.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! audio/x-raw, rate=16000, channels=1, format=S16LE ! audiomixer blocksize=320 ! udpsink host= port=10000

This above pipeline takes audio from an MP3 file, decodes it, changes the format to 16 KHz mono, and then sends it to the network using UDP. Audio mixer is used just to send the frame size of 10 msec amounting to 320 bytes of data.

gst-launch-1.0 -v udpsrc port=10000 ! rawaudioparse use-sink-caps=false format=pcm pcm-format=s16le sample-rate=16000 num-channels=1 ! queue ! audioconvert ! audioresample ! autoaudiosink

To play the same from network the above pipeline could be used.


Read Full Post »

%d bloggers like this: