MCPcopy Create free account
hub / github.com/MeiGen-AI/InfiniteTalk / audio_prepare_single

Function audio_prepare_single

app.py:349–357  ·  view source on GitHub ↗
(audio_path, sample_rate=16000)

Source from the content-addressed store, hash-verified

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

Callers 2

audio_prepare_multiFunction · 0.70
generate_videoFunction · 0.70

Calls 2

extract_audio_from_videoFunction · 0.70
loudness_normFunction · 0.70

Tested by

no test coverage detected