Пример #1
0
 def _run(self, robot, options):
     sound = audio_pb2.Sound(name=options.name)
     gain = options.gain
     if gain:
         gain = max(gain, 0.0)
     robot.ensure_client(AudioClient.default_service_name).play_sound(
         sound, gain)
Пример #2
0
def _create_fake_sound(name='fake-sound'):
    sound = audio_pb2.Sound()
    sound.name = name
    return sound
Пример #3
0
 def _run(self, robot, options):
     sound = audio_pb2.Sound(name=options.name)
     with open(options.src, 'rb') as fh:
         data = fh.read()
     robot.ensure_client(AudioClient.default_service_name).load_sound(sound, data)
Пример #4
0
 def _run(self, robot, options):
     sound = audio_pb2.Sound(name=options.name)
     robot.ensure_client(AudioClient.default_service_name).delete_sound(sound)