EXT-RadioPlayer is a module for the MagicMirror project by Michael Teeuw.
This allows to play radio station on MagicMirror
This module is an Extented plugins for
MMM-GoogleAssistant
This module need
EXT-VLCServer
plugin for playing any radio station
Clone the module into your MagicMirror module folder and execute npm intall
in the module's directory.
cd ~/MagicMirror/modules
git clone https://github.com/bugsounet/EXT-RadioPlayer
cd EXT-RadioPlayer
npm install
To display the module insert it in the config.js file.
{
module: 'EXT-RadioPlayer',
position: 'top_right',
animateIn: "flipInX",
animateOut: "flipOutX",
config: {
debug: false,
minVolume: 30,
maxVolume: 75,
streams: "streamsConfig.json"
}
},
Description of config feature
Option | Description | Type | default |
---|---|---|---|
debug |
Optional Enable Log level | Boolean | false |
minVolume | Volume to set when assistant speaking (in %) | Number | 30 |
maxVolume | Volume to set when radio playing (in %) | Number | 75 |
streams | Prefered radio list streams file | String | "streamsConfig.json" |
Afin de simplifier la configuration au maximum, un recipe
a été créé.
Il suffit simplement de l'ajouter à la configuration de GoogleAssistant
Ce recipe
se nomme: EXT-RadioPlayer.fr.js
Pour l'ajouter, editer la configuration de MMM-GoogleAssistant
dans votre fichier config.js
exemple:
{
module: "MMM-GoogleAssistant",
...
config: {
...
recipes: [
"../../EXT-RadioPlayer/recipe/EXT-RadioPlayer.fr.js",
]
...
Dans le cas où vous avez déjà d'autres recipes
:
exemple:
{
module: "MMM-GoogleAssistant",
...
config: {
...
recipes: [
"../../EXT-RadioPlayer/recipe/EXT-RadioPlayer.fr.js",
"Un_autre_recipe.js"
]
...
Une fois le recipe
installé, il faudra bien sur redémarrer MagicMirror
Activez votre assistant avec votre keyword
préféré et dites par exemple:
Mets Chérie FM
L'assistant envoie les données nécessaires et se connectera à la radio demandé.
for create a radiolink for MMM-GoogleAssistant you need 2 things:
you can understand that i can't do it for all countries ...
I do it for my country (France)
then let you search with your favorite search engine
You have to create your own recipe !, I will help you to create it...
GoogleAssistant have a very good functionality... search what you have said and do something
We will use this function.
sample with one radio station (French radio Chérie FM
)
Don't worry, i will explain
var recipe = {
transcriptionHooks: {
"cheriefm": {
pattern: "mets chérie fm",
command: "cheriefm"
},
},
commands: {
"cheriefm": {
notificationExec: {
notification: "EXT_RADIO-START",
payload: (params) => {
return {
img: "modules/EXT-RadioPlayer/Logos/FR/ChérieFM.png",
link: "https://scdn.nrjaudio.fm/fr/30201/mp3_128.mp3?origine=EXT-RadioPlayer&cdn_path=audio_lbs9"
}
}
},
displayResponse: false,
soundExec: {
chime: "open"
}
}
}
exports.recipe = recipe
Explain
you can see 2 blocks in recipe:
transcriptionHooks
: it's the vocal search blockcommands
: command to execute"cheriefm": {
: identification name of the search, there i named this search cheriefm
(the name of the radio station)pattern: "mets chérie fm",
: pattern feature is the EXACT vocal search for execute a commandjarvis, mets chérie fm
command: "cheriefm"
: name of the command to execute in the commands block
cheriefm
so ... not complex !
lets continue avec commands block
there is very easy !
"cheriefm": {
: just report the command name that you have defined in transcriptionHooks
hum ... you said to me ... i have the streaming link and the logo ...
this is the place to paste it !
EXT-RadioPlayer.js
in ~/MagicMirror/modules/EXT-RadioPlayer/recipes
directory recipes: [
"../../EXT-RadioPlayer/recipe/EXT-RadioPlayer.js"
],
if you have already a recipes configuration just add it
recipes: [
"my_prefered_recipes.js",
"../../EXT-RadioPlayer/recipe/EXT-RadioPlayer.js"
],
and restart your mirror !
Prepared recipes for Italian users, you can use EXT-RadioPlayer.it.js
recipe
This recipe have 9 pre-configured radio
For sample, if you want radio kiss kiss
Jarvis ... metti radio kiss kiss
You can also make an streams file with all prefered radio streams
See streamsConfig.XX.json
file sample (XX is designed for language)
And report it into your config file in streams
feature
Note: All Prepared recipes use now prepared streams file !
Needed configured streamsConfig file
/Radio
<name>
: Will start wanted radio station or the last radio when no name given/RadioNext
: Will start next radio of the list/RadioPrevious
: will start previous radio of the list/RadioList
: will display all available radioThis module can received notification:
EXT_RADIO-STOP
: Will stop current radioEXT_RADIO-PLAY
: Start radio name
from the streams config fileEXT_RADIO-NEXT
: Play next radio of the streams config fileEXT_RADIO-PREVIOUS
: Play previous radio of the streams config fileEXT_RADIO-START
: Start radio with sended params (img: image logo of the radio
, link: Radio station stream link
)cd ~/MagicMirror/modules/EXT-RadioPlayer
npm run update