def gonext(event): sim_time = (float(current_call.time) - float(trial.time))/1000 hyp_callout = text2int(current_call.words) hyp_callout_id = callid(hyp_callout) tran_callout = text2int(display_call.get()) tran_callout_id = callid(tran_callout) new_row = [subject, trial.index + 1, trial.wintime, sim_time, current_call.words, hyp_callout, hyp_callout_id, display_call.get(), tran_callout, tran_callout_id, current_call.confidence, '' ] global data if data == 0: data = [new_row] else: data.append(new_row) current_call.nextcall() display_call.delete(0, END) display_call.insert(0, current_call.words) disp_trial.delete(0, END) disp_trial.insert(0, trial.index) playcall()
def gonext(event): sim_time = (float(current_call.time) - float(trial.time)) / 1000 hyp_callout = text2int(current_call.words) hyp_callout_id = callid(hyp_callout) tran_callout = text2int(display_call.get()) tran_callout_id = callid(tran_callout) new_row = [ subject, trial.index + 1, trial.wintime, sim_time, current_call.words, hyp_callout, hyp_callout_id, display_call.get(), tran_callout, tran_callout_id, current_call.confidence, '' ] global data if data == 0: data = [new_row] else: data.append(new_row) current_call.nextcall() display_call.delete(0, END) display_call.insert(0, current_call.words) disp_trial.delete(0, END) disp_trial.insert(0, trial.index) playcall()
audio_folders = natural_sort(audio_folders) speech_files = [] for n in all_data: if 'speech' in n: speech_files.append(n) speech_files = natural_sort(speech_files) if speech_files[0][16] == '_': sub_id = speech_files[0][15] else: sub_id = speech_files[0][15:17] trial = Trial() call = CallOut() go = True while go: sim_time = int(call.time) - int(trial.time) hyp_callout = text2int(call.words) hyp_callout_id = callid(hyp_callout) new_row = [ sub_id, trial.index + 1, sim_time, call.words, hyp_callout, hyp_callout_id ] if data == 0: data = [new_row] else: data.append(new_row) if trial.ncalls == call.index + 1: if trial.index == 23: go = False else:
current_call = CallOut() callout_ids = ['450 ft', '400 ft', '350 ft', '7 %', '300 ft', '250 ft', '225 ft', '200 ft', '6 %', '175 ft', '150 ft', '140 ft', '5 %', '130 ft', '120 ft', '110 ft', '100 ft', '4 %'] def callid(call): global callout_ids if call in callout_ids: return callout_ids.index(call) + 1 else: return -1 data = 0 go = True while go: sim_time = float(current_call.time) - float(trial.time) hyp_callout = text2int(current_call.words) hyp_callout_id = callid(hyp_callout) new_row = [subject.id, trial.index + 1, sim_time, current_call.words, hyp_callout, hyp_callout_id] if data == 0: data = [new_row] else: data.append(new_row) if current_call.index== (trial.ncalls - 1): if trial.index == 23: if subject.index==len(subjects) -1: go = False else: subject.nextsubj()
audio_folders = natural_sort(audio_folders) speech_files = [] for n in all_data: if 'speech' in n: speech_files.append(n) speech_files = natural_sort(speech_files) if speech_files[0][16] == '_': sub_id = speech_files[0][15] else: sub_id = speech_files[0][15:17] trial = Trial() call = CallOut() go = True while go: sim_time = int(call.time) - int(trial.time) hyp_callout = text2int(call.words) hyp_callout_id = callid(hyp_callout) new_row = [sub_id, trial.index + 1, sim_time, call.words, hyp_callout, hyp_callout_id] if data == 0: data = [new_row] else: data.append(new_row) if trial.ncalls == call.index + 1: if trial.index == 23: go = False else: trial.nexttrial() call = CallOut()