TuneIn Internet Radio Streaming Skill - testing and feedback


#1

First time skill writer looking for feedback on this skill to play internet radio streams based on your search term.

How to install mycroft-skill-tunein

  • Install mycroft-skill-tunein by
    • Using msm to install from my repo:

msm install https://github.com/johnbartkiw/mycroft-skill-tunein

  • mycroft-skill-tunein connects to TuneIn Internet radio directory
    • This skill uses the public TuneIn web API that doesn’t require an account or any authentication.
    • There are no settings required for this skill

How to test mycroft-skill-tunein

After install there are no further steps to configure as there are no settings.

  • Speak `Intent phrase “Stream” followed by a station name, number, genre, etc. to search for.

  • Valid intent forms:

  • “Stream KEXP”

  • “Stream Jack FM Radio”

  • “Stream Jazz 24 internet radio”

  • “Stream 80s Metal (on|with|using) tune in”

  • “Stream 70s Country radio (on|with|using) tune in”

  • “Stream 99.9 internet radio (on|with|using) tune in”

  • “Stream 107.7 radio station”

  • “Stream NPR News internet radio station”

  • “Stream KEXP radio station (on|with|using) tune in”

  • “Stream KEXP internet radio station (on|with|using) tune in”

  • Mycroft should say it’s starting to stream a station name and then the radio audio stream should start. If it can’t find any station that matches your search criteria then it will tell you that if couldn’t find any stations matching.

Where feedback on mycroft-skill-tunein should be directed:

Feel free to leave feedback here or as an issue on the github repo (https://github.com/johnbartkiw/mycroft-skill-tunein/issues)


#2

Really love this skill with the few stations I tried (haven’t tried and categories like 80s metal)! Could you try to incorporate it with the common play Framework - that way people just have to say “play”!


#3

I looove it to. Have send a PR with Danish translation and some other minor stuff.

Also opend to issues - one by some stations fails to play and another that I cant get it to stop. The last could be related to the fat I am using Danish on my mycroft device, and the stop skill mabe isnt working:)


#4

Thanks for the quick feedback! I’ll take a peek at the PR and I appreciate the translations.

I can’t repro the problem with not being able to stop a stream but I have seen another random station that wouldn’t play. I think that it may be the format of the stream not being compatible with the player. I’ll see if something like VLC can play those streams successfully.

I had originally tried to use the common play framework but wanted to get something working easily since this is my first shot at making a skill. I’ll see if I can get that incorporated now that I have basic intents working.


#5

That is a really cool skill. Just found out that my favorite German music stations are available on TuneIn as well!

PR with German translation and .gitignore is waiting for you…


#6

The problem that some stations dosnt play seems to be that some stations uses .m3u file and not a plain mp3 file. So the play_mp3 command just passes the url to the player (which on picroft and mark1 are mpg123.

mpg123 can pay streams from a mp3 right from the url. To play a m3u file there is need for parameter -@ as is told in the log.

But there dosnt seem to be a way to pass parameter to the mpg123 via the play_mp3 function :frowning:

So I think there is thre waays to go….

Adding stuf to play the stream your self (look at the play_mp3 funvtion and use that and add optional parameter)

Or if the url is a m3u - get it parse it and get the stream url and pass that to play_mp3

Or make the changes to the play_mp3 function in core so it can take optional parameterand.


#7

Or maybe just make a hack like this:

if self.stream_url[-3:] == 'm3u':
    self.process = play_mp3(self.stream_url[:-4])
else:
    self.process = play_mp3(self.stream_url)
return

on line 80

I notied that the stations I had problems whit used a url like this
http://live-icy.gss.dr.dk/A/A03H.mp3.m3u
and just by removing the last part it worked.

But maybe test with other stations and not only DR P1 like I have.


#8

That all makes sense and I was able to repro. Give me a day or so to check out some other options before I go for the hack.


#9

I’ve updated the skill to use the common play framework. My own testing appeared to work find but I honestly haven’t tested it enough with the other skills that utilize the framework to understand where it may fail.

I also changed the extension stripping code a bit to make it easier to add onto later.


#10

.pls files may also need to be handled differently

Triple J Uneartherd for example provides this url:
http://www.abc.net.au/res/streaming/audio-live/shout-mp3/unearthed.pls

which contains two usable streams, both play the same thing. So you would need to parse that file, and extract the stream url instead of using the playlist url.

Love this skill though. I’m such a lazy music lover, so much easier if someone else decides what songs I’m going to listen to :smile:


#11

Thanks for the test case. I’ll see if I can get parsing of results that serve up a .pls file handled correctly.


#12

It was easier to get quick parsing together than I thought. I tested with normal mp3 streams, streams that return .m3u files and .pls files and it appears to work now. Let me know if there are any other broken test examples that you can find.


#13

Totaly great skill

Works super well on en-us, but I do have problems getting it to work on da-dk.

If saying
“stream dr p1” he will play dr p1, but
“spil dr p1” he answers that he cant find that station

Looking at the code to figure out gave me headace, as i am not well in regex, and I think it is the paring of the utterance that are different when using common_play and or call the skill directly by the intent_file_handler


#14

I’m assuming that spil is “play” in da-dk and that you’re testing the common play path?

Do you have translated regex’s locally since I don’t have those in the depot yet?

I’ve noticed that sometimes that particular regex can return no stations. I haven’t had time to dive into logs on a repro. I’ve had no problem with some of the longer regex matches. So in en-us something like:

“play KEXP on tune in” instead of just

"play KEXP:


#15

yes I have translated the regex localy, and PR them when I get it to work. And spil = play :slight_smile:
ti works for some stations but not the DR P1 and NPR news. Cant see any thing why…

and “spil dr p1 på tune in” (that is play dr p1 on tune in) dosnt work. But on my mark_1 who speaks en-us it does work by “play dr p1” or “play dr p1 on tune in”

So it has to be someting regarding to the regex which I am not god at understanding.


#16

I’m not a regex wizard either but hopefully we can figure this out. :slight_smile: A couple of questions:

  1. Does that regex form work on other station names or do they all fail?
  2. Does the regex still fail if you input the string via the cli instead of by voice?
  3. What shows up in the debug log for the search term in that situation? (LOG.debug("Could not find a station with the query term: " + search_term))

-j


#17

It seems that the data is “spil dr p1” and not as expected “dr p1” when this is called

 def CPS_start(self, phrase, data):
        LOG.debug("CPS Start: " + data)
        self.find_station(data)

#18

Ok that may be a bug in the Common Play Framework then as the “Play” part of the request is supposed to be pulled off by that before it gets to this call. Can you check the repo for that to see if maybe they don’t support da-dk yet?


#19

ohhh yes - it donst support da-dk, as I am the one translating da-dk :wink: and just did translate it fast to test your great skill.
But then I know where to look.


#20

and YES - I made a mistake in the trnslation in the common play skill…. your skill work great :slight_smile: