I currently try to capture the audio playback from my computer and forward it to an icecast2 server, sothat I am able to listen the computer playback on my internet radios.
Therefore I first grep the correct soundcard with:
pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2
and open a gstreamer pipline with:
gst-launch-1.0 pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! audioconvert ! lamemp3enc target=1 bitrate=128 cbr=true ! shout2send ip=127.0.0.1 port=8000 password=XXXXX mount=mystream.mp3
After performing the above mentioned commands I can go to pavucontrol->record and switch the record stream to "Monitor of Internal Analog Audio".
So far everything is working and a can listen to the stream on my internet radio.
Now I would like to perform the steps in a script to automatically start the stream at bootup. Unfortunately I could not find out how I can switch record stream (which I did before with pavucontrol) in a script.
BR webbolle