This commit is contained in:
adamnsandle
2020-12-15 12:34:51 +00:00
parent 557a32ed1b
commit d5a30a8664
2 changed files with 23 additions and 16 deletions

View File

@@ -224,3 +224,9 @@ def single_audio_stream(model, audio, onnx=False, trig_sum=0.26,
if state[0]:
states.append(state[0])
yield states
def collect_speeches(tss, wav):
speech_chunks = []
for i in tss:
speech_chunks.append(wav[i['start']: i['end']])
return torch.cat(speech_chunks)