Author Topic: Internet Radio  (Read 22288 times)

0 Members and 1 Guest are viewing this topic.

StrikemanXL

  • $upporter
  • Jr. Member
  • *****
  • Posts: 13
  • Karma: 1
    • View Profile
Re: Internet Radio
« Reply #15 on: August 23, 2013, 04:59:29 AM »
Thanks JJ that worked a treat and the new VC version works great :) thank you.
I found this to open .pls files in WMP http://openplsinwmp.codeplex.com/

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Internet Radio
« Reply #16 on: August 23, 2013, 09:21:14 AM »
Thanks.  I believe both MediaMonkey and iTunes can open them without modification.
« Last Edit: August 23, 2013, 11:43:37 AM by nime5ter »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Internet Radio
« Reply #17 on: August 23, 2013, 11:48:50 AM »
FWIW, on my Windows 8 machine I had no difficulty getting the code to work, streaming using MediaMonkey, but when I tried to add a Stop Stream command (MM.Stop or MM.Pause etc.) I got an error and could not get the stream to stop.

I was able to fix the problem by setting both Media Monkey and VC to "run as administrator". If you're having similar difficulties, give this a whirl.

I am using VC 1.1.4.0, but had the same issue when I tried using an earlier 1.1x version (I forget which).
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Internet Radio
« Reply #18 on: August 23, 2013, 06:00:32 PM »
I believe this is an issue with the MediaMonkey com library that VC uses to communicate with MediaMonkey.  It seems to behave differently on different systems, but the problem actually has nothing to do with streaming audio in particular.  If you try any command from VC to control MediaMonkey you will have this issue.

On my various windows systems (including a win8.1 preview) I have not had this problem even with UAC turned on.  I only needed to run MM once as administrator and from then on no problems, and I never have to run VC as admin.  I don't know why your system is different but seeing is believing!
« Last Edit: August 23, 2013, 06:08:31 PM by jitterjames »

Tecni

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: Internet Radio
« Reply #19 on: October 09, 2013, 04:06:41 AM »
 Hi,I try modify the script for radio.de but dosnt work. Need a little bit help ^^ with Results.RegEx action. Ty

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="333" name="radioscrape" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <cmdString>http://www.radio.de/#%2Fsendersuche.jsf%3Fq%3D{1}%26u%3Dall</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

 
« Last Edit: October 09, 2013, 04:40:02 AM by Kalle »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Internet Radio
« Reply #20 on: October 09, 2013, 04:50:27 AM »
Hi Tecni and welcome to VC forum.
I'm not sure which script you mean (there are more then one script in this topic)  ;)
You can post a VC command group by using the square icon above (#), so we can take a look on it.
***********  get excited and make things  **********

Tecni

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: Internet Radio
« Reply #21 on: October 09, 2013, 07:24:02 AM »
I want use this script for radio.de

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="798" name="shoutcast genre" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>VC.Standby</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Stop</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <cmdString>http://www.shoutcast.com/radio/{1}</cmdString>      (for radio.de <cmdString>http://www.radio.de/#%2Fsendersuche.jsf%3Fq%3D{1}%26u%3Dall</cmdString> )
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <cmdString>href="(.*?)".*?class="playbutton</cmdString>             (dont know... tried  id )
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecString</cmdType>
    <cmdString>import random</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecString</cmdType>
    <cmdString>result = random.randint(1,{#M})</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString> {#M} Radiosender gefunden, spiele nummer {LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.TriggerEvent</cmdType>
    <cmdString>playRadioMatch&amp;amp;&amp;amp;{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Standby</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>shoutcast, inizialisiere radio</phrase>
  <phrase>genre, station</phrase>
  <payloadList>Alternative,Blues,Classical,Country,Decades,Easy Listening,Electronic,Metal,Oldies,New Age,Pop,Public Radio,Rap,Reggae,Rock,</payloadList>
</command>
« Last Edit: October 14, 2013, 10:51:44 PM by jitterjames »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Internet Radio
« Reply #22 on: October 09, 2013, 01:33:32 PM »
I'm happy to help you with the regex, but since the site you are using works differently from shoutcast, you'll have to do more than get the regex right for this command to work properly.

To return a list of URL matches for the genre of radio stations you've asked for, you can use the regex:
Code: [Select]
cmdType>Results.RegEx</cmdType>
    <cmdString>linkobject=.*url\'\:\'(.*?)\'.*?bcastid=</cmdString>
    <cmdRepeat>1</cmdRepeat>

(This is when scraping the URL that you provided for us: http://www.radio.de/#%2Fsendersuche.jsf%3Fq%3D{1}%26u%3Dal )

However, the rest of James's original command group is designed to work with .pls multimedia playlists, whereas your site uses a built-in Flash player for each radio station.

You can still use the above regex to get the station URLs, but I imagine you'll want to use the Launch.URL action or something like that to open one of those matches in your browser. The challenge will be in finding a way to return a random match from the list of URLs.

Let us know if you'd like more help with that. It might be fun to try on your own first, so I am just answering the question that you initially posed. :)
« Last Edit: October 09, 2013, 01:45:23 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Internet Radio
« Reply #23 on: October 10, 2013, 04:26:27 PM »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Internet Radio
« Reply #24 on: October 14, 2013, 10:37:44 PM »
Here is a group of commands that work with rad.io (and radio.de with minor adjustment) but you will need VC version 1.163 for it to work.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="scrape rad io" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1120" name="radio play genre {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.UserAgent</cmdType>
      <cmdString>http://www.rad.io/info/menu/broadcastsofcategory?category=_genre&amp;value={1}&amp;&amp;VoxCommando</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>"id":(.*?),</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="True">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>Error.</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <cmdString />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <cmdString>radioID&amp;&amp;{Match.Rnd}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape.UserAgent</cmdType>
      <cmdString>http://www.rad.io/info/broadcast/getbroadcastembedded?broadcast={Var.radioID}&amp;&amp;VoxCommando</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>"(?:streamUrl|name|description)":"(.*?)"</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>Now Playing {Match.3}, {Match.2}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Sound.PlayStream</cmdType>
      <cmdString>{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Sound.SetStreamVol</cmdType>
      <cmdString>50</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>Now Playing {Match.3}, {Match.2}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>radio play genre</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\RadioGenres.xml</payloadFromXML>
  </command>
  <command id="1101" name="set stream volume" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Sound.SetStreamVol</cmdType>
      <cmdString>{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>set stream volume</phrase>
    <payloadList>10,20,30,40,50,60,70,80,90,100</payloadList>
  </command>
  <command id="1116" name="what radio station is this" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Sound.GetStreamInfo</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>name:(.*)</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>You are listening to: {Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>what radio station is this</phrase>
  </command>
  <command id="1134" name="sound.getstreaminfo" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.SetFontSize</cmdType>
      <cmdString>14</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Sound.GetStreamInfo</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{LastResult}&amp;&amp;6000&amp;&amp;-100</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>System.SetClipboardText</cmdType>
      <cmdString>{LastResult}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
  <command id="188" name="radio stop" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Sound.StopStream</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>radio stop</phrase>
  </command>
</commandGroup>

Tecni

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: Internet Radio
« Reply #25 on: October 16, 2013, 01:25:20 PM »
Thanks  :) :) i test it later.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Internet Radio
« Reply #26 on: October 22, 2013, 08:42:36 AM »
Yes.  You should.

Tecni

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 0
    • View Profile
Re: Internet Radio
« Reply #27 on: October 25, 2013, 08:26:49 AM »
Works well.Thanks

Is it possible to write the url in a pls data? ::)
« Last Edit: October 28, 2013, 09:20:09 AM by Tecni »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Internet Radio
« Reply #28 on: October 30, 2013, 08:17:02 AM »
create as new from the post above

Is it possible to write the url in a pls data? Roll Eyes
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Internet Radio
« Reply #29 on: October 30, 2013, 08:48:00 AM »
Was that supposed to be a bump?

The answer is yes.

A more detailed question will result in a more detailed answer.  >:D