def play_off_hook(self): if not G.playing: return x = audio.stop_playing() G.playing = 0 audio.setoutgain(G.nomuting * G.gain) G.recbtn.enable(1) G.window.settimer(0) start_vu()
def stop_hook(self): if G.busy: audio.setoutgain(0) dummy = audio.stop_playing() G.busy = 0
try: hdr = sunaudio.gethdr(fp) except sunaudio.error, msg: hdr = () if hdr: data_size = hdr[0] data = fp.read(data_size) # XXX this doesn't work yet, need to convert from uLAW!!! del fp else: del fp data = readfile(tempname) if G.debug: print len(data), 'bytes read from', tempname if G.busy: G.busy = 0 dummy = audio.stop_playing() # # Completely reset the audio device audio.setrate(G.rate) audio.setduration(0) audio.setoutgain(G.gain) # if G.synchronous: audio.write(data) audio.setoutgain(0) else: try: audio.start_playing(data) G.busy = 1 except: stdwin.fleep()