From da7979113da1aeb57a45ad065be2d5b091f9406e Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Tue, 10 Dec 2024 13:37:55 +0100 Subject: [PATCH 1/3] Update 1_AudioFile.py --- services/1_AudioFile.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/services/1_AudioFile.py b/services/1_AudioFile.py index 024b7fd15..e07b95b69 100644 --- a/services/1_AudioFile.py +++ b/services/1_AudioFile.py @@ -133,3 +133,27 @@ def previousPlay(): else: i01.warn("i01.chatBot needs to be started") +def startRadio(station): + if runtime.isStarted("i01.audioPlayer"): + audioPlayer = runtime.getService("i01.audioPlayer") + audiocfg = audioPlayer.getConfig() + print("Radio started") + if audiocfg.stream == 0: + audiocfg.stream = 1 + audioPlayer.save() + audioPlayer.apply(audiocfg) + audioPlayer.broadcastState() + print(station) + audioPlayer.playFile(station) + +def stopRadio(): + if runtime.isStarted('i01.audioPlayer'): + audioPlayer = runtime.getService('i01.audioPlayer') + audioPlayer.stop() + print("Radio stopped") + audiocfg = audioPlayer.getConfig() + if audiocfg.stream == 1: + audiocfg.stream = 0 + audioPlayer.save() + audioPlayer.apply(audiocfg) + audioPlayer.broadcastState() From 65a2c2d49a09974aabbe7ef216849c7fd41c183c Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Tue, 10 Dec 2024 13:39:45 +0100 Subject: [PATCH 2/3] Delete gestures/startRadio.py --- gestures/startRadio.py | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 gestures/startRadio.py diff --git a/gestures/startRadio.py b/gestures/startRadio.py deleted file mode 100644 index 9ad8f0ec8..000000000 --- a/gestures/startRadio.py +++ /dev/null @@ -1,24 +0,0 @@ -def startRadio(station): - if runtime.isStarted("i01.audioPlayer"): - audioPlayer = runtime.getService("i01.audioPlayer") - audiocfg = audioPlayer.getConfig() - print("Radio started") - if audiocfg.stream == 0: - audiocfg.stream = 1 - audioPlayer.save() - audioPlayer.apply(audiocfg) - audioPlayer.broadcastState() - print(station) - audioPlayer.playFile(station) - -def stopRadio(): - if runtime.isStarted('i01.audioPlayer'): - audioPlayer = runtime.getService('i01.audioPlayer') - audioPlayer.stop() - print("Radio stopped") - audiocfg = audioPlayer.getConfig() - if audiocfg.stream == 1: - audiocfg.stream = 0 - audioPlayer.save() - audioPlayer.apply(audiocfg) - audioPlayer.broadcastState() \ No newline at end of file From 7f79529a93823a864e1ea269fc2d5491ff990084 Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Tue, 10 Dec 2024 13:42:44 +0100 Subject: [PATCH 3/3] add radio options --- peers/ProgramAB/fr-FR/aiml/jukebox.aiml | 87 +++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/peers/ProgramAB/fr-FR/aiml/jukebox.aiml b/peers/ProgramAB/fr-FR/aiml/jukebox.aiml index a6a4c0441..c59d8d70a 100644 --- a/peers/ProgramAB/fr-FR/aiml/jukebox.aiml +++ b/peers/ProgramAB/fr-FR/aiml/jukebox.aiml @@ -241,6 +241,8 @@ END_PLAYLIST + + * RADIO * + + * MUSIQUE CLASSIQUE + + + + + * MUSIQUE DE JAZZ + + + + + * MUSIQUE DE FILM + + + STOP LA RADIO + + + STOPPE LA RADIO + + + + + STOPPE LA MUSIQUE + + + + + ÉTEINS LA RADIO + + + \ No newline at end of file