Updated loudspeaker actuator
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-10-01 18:05:03 +02:00
parent 2fd833775a
commit a223c8e95e

View File

@ -21,12 +21,10 @@ class Loudspeaker(AbcActuator):
"""
def __init__(self, sound_dir: str):
BirbnetesIoTPlatformPlaybackDriver.init()
self._sound_dir = sound_dir
BirbnetesIoTPlatformPlaybackDriver.init(sound_dir)
def act(self):
choice = random.choice(os.listdir(self._sound_dir))
BirbnetesIoTPlatformPlaybackDriver.play_audio(os.path.join(self._sound_dir, choice))
BirbnetesIoTPlatformPlaybackDriver.play_one_random()
def __del__(self):
BirbnetesIoTPlatformPlaybackDriver.cleanup()