Author Topic: Switch web radio  (Read 4258 times)

manoah

  • Newbie
  • *
  • Posts: 6
Switch web radio
« on: June 06, 2013, 07:45:12 pm »
Hello,
I need that in case of silence the program can switch from one radio to another by file .pls
Currently I can switch from radio A to radio B if A is faulty, but I can not get on the radio B to the radio   A  when the radio B gives any problems
anyone can help me?
TY

Jan

  • Hero Member
  • *****
  • Posts: 838
Re: Switch web radio
« Reply #1 on: June 06, 2013, 09:58:05 pm »
On the silence event Run the bat file provided below. This file will provide the source switching.
Fill the .pls path and filename on the marked positions, remove the '*' and save the bat file to your hard disk to a folder where write access is enabled, for example c:\your_folder\switch.bat

Code: [Select]
SET LAST_SRC=A
FOR /F "tokens=1" %%G IN (switch.txt) DO SET LAST_SRC=%%G
IF %LAST_SRC%==A GOTO Last_A

:Last_B
echo A>switch.txt
start *insert the source A .pls file here*
GOTO End

:Last_A
echo B>switch.txt
start *insert the source B .pls file here*

:End

manoah

  • Newbie
  • *
  • Posts: 6
Re: Switch web radio
« Reply #2 on: June 07, 2013, 12:15:48 am »
Thank you very much, it's great just what I wanted!!!

manoah

  • Newbie
  • *
  • Posts: 6
Re: Switch web radio
« Reply #3 on: June 11, 2013, 12:23:58 pm »
I have this problem, sometimes both radio A and Radio B are down. With your script Pira CZ Silence Detector goes from A (which is dumb) to B which is just as dumb and remains locked because the status remains on SILENCE, even changing the program settings "Status After start-up." Could it be that the program continues to change between A B and maybe even C(other radio) until it finds an audio source?
  Do you have a solution for that too?
Thanks 1000

Jan

  • Hero Member
  • *****
  • Posts: 838
Re: Switch web radio
« Reply #4 on: June 11, 2013, 01:19:54 pm »
OK, I understand. In case that both sources A and B are dead, you need to loop through them again and again until some source gets playing.
For this purpose the Silence Detector provides Delay and Repeat functions (tasks), combined with "Break alarm task queue" option in Setup/Alarm activation.

manoah

  • Newbie
  • *
  • Posts: 6
Re: Switch web radio
« Reply #5 on: June 13, 2013, 11:01:19 am »
thank you so much, works very well :D