How to use the safeeyes.Utility.get_resource_path function in safeeyes

To help you get started, we’ve selected a few safeeyes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github slgobinath / SafeEyes / safeeyes / plugins / audiblealert / plugin.py View on Github external
def play_sound(resource_name):
    """Play the audio resource.

    Arguments:
        resource_name {string} -- name of the wav file resource
    """
    logging.info('Playing audible alert %s', resource_name)
    try:
        # Open the sound file
        path = Utility.get_resource_path(resource_name)
        if path is None:
            return
        Utility.execute_command('aplay', ['-q', path])

    except BaseException:
        logging.error('Failed to play audible alert %s', resource_name)