Mycroft Community Forum

Radio skill based on pyradios

How to install Radio

  • Install Radio by
mycroft-msm install https://github.com/andlo/radio-skill.git

The uses pyradios from PyPi and that is instaled from the manifest.yml

The skill uses default audio backend just like the npr-skill and only uses the Common Play Framework
https://mycroft-ai.gitbook.io/docs/skill-development/skill-types/common-play-framework

How to test Radio

Play your favorite radiostation by or use one of these examples

hey mycroft - play radio BBC Radio 1"
hey mycroft - play radio KEXP

If Mycroft starts playing everything works as expeted - if not - it could be that you dind say a name of a radio that he could parse or find. It is diffucult to speak many radio names as they are not written funny like “Radio4” and mycroft will hear that as “Radio 4”. I have problem getting danish radio “DR P1” as he mostly hear something like “Dear Are Pee One”.
But you can use Mycroft-cli and write the name… Ideas for how to “translate” better between radio station names and spoken words are most welcome.

I think enhancing with user configured programs is soem way to work around this problem.
adding posibility to

Hey mycroft - play radio program 1

and have a setting on home for Program 1 to 5 could make the skill more usefull.

Feedback and ideas for making skill better please through Issues on GitHub, or via Mycroft Chat or here as reply on this thread.
You are also welcome to fork change and make Pull Requessts.

The idea for this skills comes from @StuartIanNaylor in this topic

enjoy and happy mycrofting :slight_smile:

2 Likes

Brilliant @andlo :+1:

A bit of a warning, on Mark-1’s this skill currently leads to a version conflict hindering core from starting up (leaving the device in yellow eyes mode) after installing this skill. We’ll need to bump core’s version requirement of requests to ensure compatibility.

1 Like

Ohhh - Ill could maybe use another way :wink: It wassnt in use anyway. I wanted to add a check if the url for the stream actual were working, but I couldnt get it to work.

I could just chnge using requests to httplib

changing from

    def exists_url(url):
        r = requests.head(url)
        if r.status_code < 400:
            return True
        else:
            return False

to

    def exists_url(url):
        c = httplib.HTTPConnection(url)
        c.request("HEAD", '')
        if c.getresponse().status < 400:
            return True
        else:
            return False
``

The problem is that pyradios depends on requests >= 2.22.0 which conflicts with core’s requests == 2.20.0 so we should upgrade in core anyways or maybe even making core’s requirement more slack.

Ohh I see. Then until that part is solved the skill should have supported devices and not ahve platform_mark1 there.