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):
|
def __init__(self, sound_dir: str):
|
||||||
BirbnetesIoTPlatformPlaybackDriver.init()
|
BirbnetesIoTPlatformPlaybackDriver.init(sound_dir)
|
||||||
self._sound_dir = sound_dir
|
|
||||||
|
|
||||||
def act(self):
|
def act(self):
|
||||||
choice = random.choice(os.listdir(self._sound_dir))
|
BirbnetesIoTPlatformPlaybackDriver.play_one_random()
|
||||||
BirbnetesIoTPlatformPlaybackDriver.play_audio(os.path.join(self._sound_dir, choice))
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
BirbnetesIoTPlatformPlaybackDriver.cleanup()
|
BirbnetesIoTPlatformPlaybackDriver.cleanup()
|
||||||
|
Loading…
Reference in New Issue
Block a user