Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)