def play_sequence(names): """play a sequence of sounds or texts, each one interruptible""" sound_stop() for name in names: voice.important([name]) # each element is interruptible
def close_media(): """try to clean up before closing the client""" sound_stop() pygame.quit() tts.close()
def modify_volume(incr): """increase or decrease the main volume, and say it""" set_volume(min(1, max(0, get_volume() + .1 * incr))) sound_stop() voice.item(nb2msg(round(get_volume() * 100)) + mp.PERCENT_VOLUME)
def play_sequence(names): """play a sequence of sounds or texts, each one interruptible""" sound_stop() for name in names: voice.important([name]) # each element is interruptible
def close_media(): """try to clean up before closing the client""" sound_stop() pygame.quit() tts.close()
def modify_volume(incr): """increase or decrease the main volume, and say it""" set_volume(min(1, max(0, get_volume() + .1 * incr))) sound_stop() voice.item(nb2msg(round(get_volume() * 100)) + mp.PERCENT_VOLUME)