def set_audio_mode(new_mode):
 if (new_mode in ('voice and sound', 'silent', 'voice only', 'sound only')):
  global audio_mode
  audio_mode = new_mode

def set_audio_mode ( new_mode ) : if ( new_mode in ( 'voice and sound' , 'silent' , 'voice only' , 'sound only' ) ) : global audio_mode audio_mode = new_mode
a save way to set the audio mode .