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

Function audio_prepare_multi

app.py:270–288  ·  view source on GitHub ↗
(left_path, right_path, audio_type, sample_rate=16000)

Source from the content-addressed store, hash-verified

268 return normalized_audio
269
270def audio_prepare_multi(left_path, right_path, audio_type, sample_rate=16000):
271 if not (left_path=='None' or right_path=='None'):
272 human_speech_array1 = audio_prepare_single(left_path)
273 human_speech_array2 = audio_prepare_single(right_path)
274 elif left_path=='None':
275 human_speech_array2 = audio_prepare_single(right_path)
276 human_speech_array1 = np.zeros(human_speech_array2.shape[0])
277 elif right_path=='None':
278 human_speech_array1 = audio_prepare_single(left_path)
279 human_speech_array2 = np.zeros(human_speech_array1.shape[0])
280
281 if audio_type=='para':
282 new_human_speech1 = human_speech_array1
283 new_human_speech2 = human_speech_array2
284 elif audio_type=='add':
285 new_human_speech1 = np.concatenate([human_speech_array1[: human_speech_array1.shape[0]], np.zeros(human_speech_array2.shape[0])])
286 new_human_speech2 = np.concatenate([np.zeros(human_speech_array1.shape[0]), human_speech_array2[:human_speech_array2.shape[0]]])
287 sum_human_speechs = new_human_speech1 + new_human_speech2
288 return new_human_speech1, new_human_speech2, sum_human_speechs
289
290def _init_logging(rank):
291 # logging

Callers 1

generate_videoFunction · 0.70

Calls 1

audio_prepare_singleFunction · 0.70

Tested by

no test coverage detected