get_predefined_sounds()
  • 1 Minute to read

get_predefined_sounds()


Article summary

Returns a list with all the prederfined sounds that can be played.

Arguments

None

Return

Returns a list of predefined sounds names.

Example

Code:

from raya.application_base import RayaApplicationBase

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

    async def loop(self):
                self.sounds =  self.sound.get_predefined_sounds()
        print(self.sounds)
        self.finish_app()

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

Console output:

['happy', 'finish_task', 'on_the_go']

Was this article helpful?

What's Next