This guide will briefly explain how to create a network music stream server using the sound actually played on your sound card. I use to find this trick especially useful when I m sitting on my balcony with my laptop and in the same I can stream Pandora web radio via WiFi into my home music system (for the great happiness of my neighbours).
What you will need:
1. A computer with network connection.
2. A mobile phone able to connect to your PC via network and with the ability to play network mp3 streams. (I have an N95 8G phone with installed player CorePlayer. )
Setup:
- Install pavucontrol, vlc player and sox.
- Get the name of your sound card monitor device. Run in terminal:
pactl list | grep -A2 'Source #' | grep 'Name: .*\.monitor$' | cut -d" " -f2
The command should return something like this:
alsa_output.pci_8086_293e_sound_card_0.monitor - Run pavucontrol from your terminal and in 'Input devices' set the 'Show' option to 'All devices' . Find the monitor device and make sure that it is not muted.
- Configure your network for some IP. For example 192.168.2.2.
- Start up some music in your favourite music player.
- Now let's convert the output of the monitor device of your sound card to an mp3 stream. Run this in the terminal:
parec --device=alsa_output.pci_8086_293e_sound_card_0_alsa_playback_0.monitor --format=s16le --rate=44100 --channels=2 | sox --type raw -s2L --rate 44100 --channels 2 - --type wav - | cvlc -v - --sout '#transcode{vcodec=mp4v,acodec=mp3,vb=800,ab=128}:standard{access=http,mux=raw,dst=192.168.2.2:8080}'
where pci_8086_293e_sound_card_0_alsa_playback_0.monitor is the name of your monitor device and 192.168.2.2:8080 is your PC's IP address with the streaming port. Yes, it looks freaky. - Connect your audio input of your mobile phone to your home audio system and play the 192.168.2.2:8080 stream in your mobile. With
few seconds delay you should hear the output of your PC's sound monitor device.
1 komentárov:
This is awesome! Do you know how it could be done through Windows?
Post a Comment