Author Topic: Reciva Radio as speaker to Windows PC using VLC and SWYH  (Read 2268 times)

A. Black

  • Sr. Member
  • ****
  • Posts: 108
  • Thanked: 5 times
  • OS:
  • Windows NT 6.3 Windows NT 6.3
  • Browser:
  • Chrome 41.0.2272.89 Chrome 41.0.2272.89
Reciva Radio as speaker to Windows PC using VLC and SWYH
« on: 14:32:10 | 23 March, 2015 »
These instructions are now superceded by version 2 of the instructions found here:
http://iradioforum.net/forum/index.php?topic=1945.msg19081#msg19081

These instructions allow a Reciva radio to act as a remote speaker to a Windows PC using
Stream What You Hear (SWYH) and vlc - both free software.

Setup (only needs to be done once):
1. Download and install SWYH and vlc on a Windows PC.
    Both are free and have automated installers so are trival to install.
      http://www.streamwhatyouhear.com/download/
      http://www.videolan.org/vlc/download-windows.html
2. Start SWYH and right click it in tray.  Choose Tools and then Setup, check
    "Use specific Http port" checkbox and ensure 5901 is entered. Click OK and exit SWYH.
3. Go to your free Reciva account at www.reciva.com (or set up one if you have not already).
4. At Windows cmd line enter this single line:
     ipconfig
   Using the first IP4 address, e.g. on my computer it was 92.168.0.196,
   enter this into the My Streams section of your Reciva account:
     http://192.168.0.196:8085/vlc.mp3
   except replace the 192.166.0.196 part with the IP address you
   found using ipconfig.  The one you want is likely the first IP4 address
   that ipconfig displays but if not try the others too.
5. On your Reciva radio access that stream and set a preset to it.
6. Create a file called vlc_reciva.bat, say, containing this single line:
Code: [Select]
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" http://localhost:5901/stream/swyh.mp3 :live-caching=10 :sout=#transcode{vcodec=none,acodec=mp3,ab=500,channels=2,samplerate=44100}:http{dst=:8085/vlc.mp3} :sout-keep
To listen (this is done each time you want to use it):
1. Start SWYH, right click it in tray and choose Tools and then HTTP Live Streaming
2. Run vlc_reciva.bat
3. On your PC play whatever audio you want to hear on the radio.
4. On the Reciva radio press the preset that was set up.

Notes:
1. The audio will be delayed relative to the video on your PC.  If you
are doing this to listen over the radio in another room this won't be
an issue but if you are using it as a speaker to your PC and watching
corresponding video at the same time then it would be an issue. 
In that case see:
http://www.lifehacker.com.au/2012/05/fix-out-of-sync-audio-in-vlc-with-a-keyboard-shortcut/
http://www.lifehacker.com.au/2008/03/fix_desynchronized_video_and_audio_with_vlc-2/
http://osxdaily.com/2010/06/03/fix-audio-syncing-problems-when-playing-videos/
http://youtubeaudiosync.tumblr.com/

2. I believe that the presets are stored locally so even if the Reciva
database goes down this should still continue to work.

3. The above uses SWYH to convert the audio to an http stream and sends that
stream to vlc which sends it to the radio.  One might think that vlc would not
be needed (just send audio straight from SWYH to the radio) but I found the
audio quality was unlistenable when I did it that way.  You could always try it
in case you have better luck.

4. It would also be possible to avoid the use of SWYH by using a loopback
audio cable to connect your audio output (or headphone) jack to the audio
input (or microphone) jack.  This would require suitable changes to the vlc
command in vlc-reciva.bat (shown below).  To do that, in vlc find the name of
your microphone: click on Media at top left, choose Open Capture Device and
look at the Audio Device name pulldown.  If your microphone has the name
"Microphone (Conexant SmartAudio HD)" there then use this command in place
of the vlc command in vlc-reciva.bat:

Code: [Select]
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"  dshow:// :dshow-vdev=none :dshow-adev="Microphone (Conexant SmartAudio HD)" :live-caching=10 :sout=#transcode{vcodec=none,acodec=mp3,ab=500,channels=2,samplerate=44100}:http{dst=:8085/vlc.mp3} :sout-keep
5. Older PCs have a Stereo Mix audio input that can be used in place of the microphone. 
By using the Stereo Mix it should be possible to do the above without SWYH and without a
loopback cable.  Follow the instructions in the last point but use Stereo Mix in place of the
microphone device name.  My PC (Windows 8.1) does not have Stereo Mix so I could not try it.
« Last Edit: 05:12:53 | 17 December, 2015 by A. Black »

A. Black

  • Sr. Member
  • ****
  • Posts: 108
  • Thanked: 5 times
  • OS:
  • Windows NT 6.3 Windows NT 6.3
  • Browser:
  • Chrome 47.0.2526.80 Chrome 47.0.2526.80
Re: Reciva Radio as speaker to Windows PC using VLC and SWYH
« Reply #1 on: 05:02:17 | 17 December, 2015 »
Summary

This is version 2 of instructions describing how to use a Reciva radio to act as a remote speaker to a Windows PC using only free software -- (1) Stream What You Hear (SWYH) and (2) vlc.  There is also a brief discussion of other platforms.

These instructions supercede the older instructions.  The older instructions still work; however, with those instructions each time they were used one had to start SWYH and vlc separately (vlc was started via a batch file) but in these instructions a batch file starts them both at once.    (This was made possible by the discovery of the SWYH --streamto flag which the SWYH author recently mentioned on the SWYH forum.)

Platform

The instructions here are for Windows PCs as SWYH is only available on Windows; however, extending this approach to other platforms should be possible although not covered here:

1. other platforms likely have a counterpart to SWYH which could be substituted, or
2. in the notes there is discussion on how to eliminate SWYH (only need vlc) by  using a loopback cable.  Since vlc is available on many platforms this approach might be translatable to other platforms even without a counterpart to SWYH.

Changes

The main change from the earlier version of the instructions is that a single batch file is used to start both SWYH and vlc.  If you have already gone through those instructions then the only part of the Setup Instructions that you need to perform is step 2 (which is to create the new batch file).   The play instructions are simplified.  The notes are unchanged.

Setup Instructions

These are the setup instructions.  They only need to be performed once. 

1. Download and install SWYH and vlc on a Windows PC.   Both are free and have automated installers so are trival to install.
      http://www.streamwhatyouhear.com/download/
      http://www.videolan.org/vlc/download-windows.html

2. Create a text file called streamout.bat, say, containing just these two lines (The first line start SWYH and the second starts vlc.)

Code: [Select]
start "swyh" "%ProgramFiles(x86)%\Stream What You Hear\SWYH.exe" --streamto:http://localhost:5901/stream/swyh.mp3
start "vlc" "%ProgramFiles(x86)%\VideoLAN\VLC\vlc.exe" http://localhost:5901/stream/swyh.mp3 :live-caching=10 :sout=#transcode{vcodec=none,acodec=mp3,ab=500,channels=2,samplerate=44100}:http{dst=:8085/vlc.mp3} :sout-keep

3. Set up a preset on your Reciva radio to your PC like this:
(a) Go to your free Reciva account at www.reciva.com (or set up one if you have not already).
(b) At Windows cmd line enter this single line:
     ipconfig
   Using the first IP4 address, e.g. on my computer it was 92.168.0.196, enter the following into the My Streams section of your Reciva account:
     http://192.168.0.196:8085/vlc.mp3
   except replace the 192.166.0.196 part with the IP address you found using ipconfig.  The one you want is likely the first IP4 address
   that ipconfig displays but if not try the others too.
(c) On your Reciva radio access that stream and set a preset to it.

Play Instructions

To listen (this is done each time you want to use it) perform the following actions (in any order):

1. On your PC play whatever audio you want to hear on the radio.
2. Run streamout.bat (which in turn starts SWYH and vlc)
3. On the Reciva radio press the preset created in the setup instructions.

Notes

1. The audio will be delayed relative to the video on your PC.  If you are doing this to listen over the radio in another room this won't be
an issue but if you are using it as a speaker to your PC and watching corresponding video at the same time then it would be an issue.  In that case see:
http://www.lifehacker.com.au/2012/05/fix-out-of-sync-audio-in-vlc-with-a-keyboard-shortcut/
http://www.lifehacker.com.au/2008/03/fix_desynchronized_video_and_audio_with_vlc-2/
http://osxdaily.com/2010/06/03/fix-audio-syncing-problems-when-playing-videos/
http://youtubeaudiosync.tumblr.com/

2. I believe that the presets are stored locally so even if the Reciva database goes down this should still continue to work.

3. The above uses SWYH to convert the audio to an http stream and sends that stream to vlc which sends it to the radio.  One might think that vlc would not be needed (just send audio straight from SWYH to the radio) but I found the audio quality was unlistenable when I did it that way.  You could always try it in case you have better luck.

4. It would also be possible to avoid the use of SWYH by using a loopback audio cable to connect your audio output (or headphone) jack to the audio input (or microphone) jack.  This would require suitable changes to the streamout.bat script.  To do that, in vlc find the name of your microphone: click on Media at top left, choose Open Capture Device and look at the Audio Device name pulldown.  If your microphone has the name "Microphone (Conexant SmartAudio HD)" there then use this script in place of streamout.bat

Code: [Select]
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"  dshow:// :dshow-vdev=none :dshow-adev="Microphone (Conexant SmartAudio HD)" :live-caching=10 :sout=#transcode{vcodec=none,acodec=mp3,ab=500,channels=2,samplerate=44100}:http{dst=:8085/vlc.mp3} :sout-keep
5. Older PCs have a Stereo Mix audio input that can be used in place of the microphone.  By using the Stereo Mix it should be possible to do the above without SWYH and without a loopback cable.  Follow the instructions in the last point but use Stereo Mix in place of the microphone device name.  My PC (Windows 8.1) does not have Stereo Mix so I could not try it.
« Last Edit: 05:06:10 | 17 December, 2015 by A. Black »
The following users thanked this post: Ben H