(audio_path, sample_rate=16000)
| 346 | return human_speech_array |
| 347 | |
| 348 | def audio_prepare_single(audio_path, sample_rate=16000): |
| 349 | ext = os.path.splitext(audio_path)[1].lower() |
| 350 | if ext in ['.mp4', '.mov', '.avi', '.mkv']: |
| 351 | human_speech_array = extract_audio_from_video(audio_path, sample_rate) |
| 352 | return human_speech_array |
| 353 | else: |
| 354 | human_speech_array, sr = librosa.load(audio_path, sr=sample_rate) |
| 355 | human_speech_array = loudness_norm(human_speech_array, sr) |
| 356 | return human_speech_array |
| 357 | |
| 358 | def process_tts_single(text, save_dir, voice1): |
| 359 | s1_sentences = [] |
no test coverage detected