(audio_path, sample_rate=16000)
| 337 | return human_speech_array |
| 338 | |
| 339 | def audio_prepare_single(audio_path, sample_rate=16000): |
| 340 | ext = os.path.splitext(audio_path)[1].lower() |
| 341 | if ext in ['.mp4', '.mov', '.avi', '.mkv']: |
| 342 | human_speech_array = extract_audio_from_video(audio_path, sample_rate) |
| 343 | return human_speech_array |
| 344 | else: |
| 345 | human_speech_array, sr = librosa.load(audio_path, sr=sample_rate) |
| 346 | human_speech_array = loudness_norm(human_speech_array, sr) |
| 347 | return human_speech_array |
| 348 | |
| 349 | def process_tts_single(text, save_dir, voice1): |
| 350 | s1_sentences = [] |
no test coverage detected