| | |
| | | sleep_duration = 0.001 if args.mode == "offline" else 60 * args.chunk_size[1] / args.chunk_interval / 1000 |
| | | |
| | | await asyncio.sleep(sleep_duration) |
| | | # when all data sent, we need to close websocket |
| | | while not voices.empty(): |
| | | await asyncio.sleep(1) |
| | | await asyncio.sleep(3) |
| | | |
| | | if not args.mode=="offline": |
| | | await asyncio.sleep(2) |
| | | # offline model need to wait for message recved |
| | | |
| | | if args.mode=="offline": |
| | |
| | | wav_name = wav_splits[0] if len(wav_splits) > 1 else "demo" |
| | | wav_path = wav_splits[1] if len(wav_splits) > 1 else wav_splits[0] |
| | | audio_type = os.path.splitext(wav_path)[-1].lower() |
| | | if audio_type not in SUPPORT_AUDIO_TYPE_SETS: |
| | | raise NotImplementedError( |
| | | f'Not supported audio type: {audio_type}') |
| | | # if audio_type not in SUPPORT_AUDIO_TYPE_SETS: |
| | | # raise NotImplementedError( |
| | | # f'Not supported audio type: {audio_type}') |
| | | |
| | | total_len = len(wavs) |
| | | if total_len >= args.thread_num: |