Self-Managed Stream Player

As a “hello world” skill I created a Stream Player skill that is a different take on the Internet Radio skill and uses some ideas from the NPR News skill threads and the Dutch-Radio skill.

The Stream Player streams selections from a list of stations maintained in the user’s “Stream Player” skill configuration settings (https://account.mycroft.ai/skills).

If it works inside the Mycroft environment, this method could also be used to “open up” the list of choices for the Latest News skill.

Users can also give permission for their stream list to be searched by other users. Not sure how that could happen within Mycroft, but it could be the basis for a larger curated list of streams at some point in the future.

git clone https://github.com/Bulwagga/stream-player-skill

To use, say “stream WAMC” or “stop streaming” or “cancel streaming”. To add your own streams, add them in your skill configuration settings.

If all works correctly, after you fill the available stream fields with your preferred streams, the software will add another empty field for your use.

Hopefully this is food for thought as all these stream players converge!

Thanks

Hi Bulwagga. Very interested in this. Have you had it working? I have installed, but I’m not getting any success.
I have the following stream added to my skills configuration:

bicycle,http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p

(I have tried to use a unique name - bicycle).

At first tunein responded with a somewhat random station. I removed tunein skill and now I am getting “I don’t understand” reply from mycroft:

10:38:04.800 | INFO | 843 | main:handle_utterance:76 | Utterance: [‘stream bicycle’]
10:38:05.236 | INFO | 837 | QuestionsAnswersSkill | Searching for stream bicycle
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
10:38:06.165 | INFO | 837 | QuestionsAnswersSkill | Timeout occured check responses

Hi mattcd216, thanks for trying the skill. I have limited experience with mycroft, but i’ll do my best to help.

It looks like mycroft is falling back to the “QuestionsAnswersSkill” which I believe indicates that mycroft found no references to the keyword “stream”. This would indicate that the stream-player-skill didn’t load.

What platform are you on? I am using Ubuntu.
Is the stream-player-skill in the skills directory?
Search your skills.log file (/var/log/mycroft/skills.log in linux) to see whether the skill loaded successfully. I typically see a “Merge Conflict” but the skill loads correctly. I was able to load your station and stream it.

Thanks for your patience!

Thanks for your help Bulwagga.
I am on a pi4 running picroft.

I installed with mycroft-msm install command - did you?
It seems to receive the config update when I set the name and URL:

.mycroft_skill:handle_settings_change:308 | Updating settings for skill StreamPlayer

However when I say “hey mycroft, stream bicycle” it recognises the speech ok, but I see in the logs:

2021-03-12 14:03:24.528 | INFO | 846 | QuestionsAnswersSkill | Searching for stream bicycle
2021-03-12 14:03:24.539 | INFO | 846 | ReSpeaker_4mic_hat | Pixel Ring: Think
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2021-03-12 14:03:25.512 | INFO | 846 | QuestionsAnswersSkill | Timeout occured check responses

It seems to use QuestionsAnswersSkill immediately, but times out (also immediately).

The skill is in the ~/mycroft-core/skills directory.
The skills.log is as above.

The settings.json reads:

{“__mycroft_skill_firstrun”: false, “stream1”: “WAMC,http://playerservices.streamtheworld.com/api/livestream-redirect/WAMCHD2.mp3”, “stream2”: “bicycle,http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p”, “stream3”: “empty_record”…

I think you are right - it isn’t identifying “stream” keyword for this skill. Thoughts?

I installed with mycroft-msm. I have never run “.mycroft_skill:handle_settings_change:308 | Updating settings for skill StreamPlayer”

I wait for Mycroft to periodically update the skills, at which time I get this in the skills.log:
ERROR | 12035 | msm.mycroft_skills_manager | Error running install_or_update on stream-player-skill: MergeConflict

This doesn’t seem to affect the functionality. I believe it is due to the variable size of the .json and .yaml files.

Given the error message, I know that the streaming skill is active. There should be a line in your skills.log similar to “2021-03-13 17:56:17.056 | ERROR | 12035 | msm.mycroft_skills_manager | Error running install_or_update on stream-player-skill: MergeConflict”

in my setup, the keyword stream is found in stream-player-skill/locale/en-us/player.stream.intent.

Settings.json looks ok.

My guess is that there will be an error message in skills.log (you can search for the keyword ERROR) that causes stream-player-skill to not be loaded.

In the meantime I’ll start tinkering to see if I can solve the MergeConflict. It may be enough to keep the skill from loading in your environment.

I also have stream in the stream-player-skill/locale/en-us/player.stream.intent file.

I uninstalled and reinstalled. If I look at the skills log there are no errors, just the successful updates to settings.json. When I try a “stream…” utterance I can only see QuestionsAnswersSkill being used:

2021-03-15 15:13:59.401 | INFO | 846 | QuestionsAnswersSkill | Searching for stream bicycle

I can also see QuestionsAnswersSkill when asking a random question:

16:02:18.231 | INFO | 857 | main:handle_utterance:76 | Utterance: [‘how many ounces are in a pound’]
16:02:18.698 | INFO | 851 | QuestionsAnswersSkill | Searching for how many ounces are in a pound
16:02:20.457 | INFO | 851 | QuestionsAnswersSkill | Answer from fallback-wolfram-alpha.mycroftai

So it seems like my setup isn’t identifying stream with the stream-player skill :frowning:

I was able to duplicate this intermittently when I started mycroft from the command line with “./start_mycroft debug”. Since it’s a timeout, I commented out the logging entry in the intent handler to allow the intent handler to return sooner. To try it, either remove the line that says “LOG.info(utterance)” or download the newest copy.

If this doesn’t work, the next potential issue is that there is a bug happening when I cycle through your list of stations. In that case, please paste in your full settings.json file so I can look for the reason the while loop isn’t returning in reasonable time.

Thank you!