Updated loudspeaker actuator
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2fd833775a
commit
a223c8e95e
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user