From 4b6ce3e7e1fcb9137a16f77421684b2779588862 Mon Sep 17 00:00:00 2001 From: marcsello Date: Wed, 30 Sep 2020 00:15:17 +0200 Subject: [PATCH] Implemented audio play --- birbnetes_iot_platform_raspberry/playback_stuff.py | 13 ++++++++++++- requirements.txt | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/birbnetes_iot_platform_raspberry/playback_stuff.py b/birbnetes_iot_platform_raspberry/playback_stuff.py index 037aaa7..cc694ad 100644 --- a/birbnetes_iot_platform_raspberry/playback_stuff.py +++ b/birbnetes_iot_platform_raspberry/playback_stuff.py @@ -1 +1,12 @@ -import alsaaudio +from playsound import playsound + + +class BirbnetesIoTPlatformPlaybackDriver: + + @classmethod + def init(cls): + pass + + @classmethod + def play_audio(cls, audiofile: str): + playsound(audiofile) diff --git a/requirements.txt b/requirements.txt index 2943951..2de630e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ RPi.GPIO -pyalsaaudio \ No newline at end of file +pyalsaaudio +playsound \ No newline at end of file