play_predefined_sound()
  • 1 Minute to read

play_predefined_sound()


Article summary

play_predefined_sound()

Play a predefined sound in the robot.

You can find a list of predefined sounds, including suggested use cases for each of them under this section.

Arguments

ArgumentsType
inter_namestringname of the predefined sound
waitboolIf True, code will be blocked until the end of the sound. Default value is False.

Return

None

Example

from raya.application_base import RayaApplicationBase

class RayaApplication(RayaApplicationBase):
    async def setup(self):
        self.sound = await self.enable_controller('sound')

    async def loop(self):
        await self.sound.play_predefined_sound('charging')
        self.finish_app()

    async def finish(self):
        self.log.info(f'Hello from finish()')

Was this article helpful?