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

Function audio_prepare_multi

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

Source from the content-addressed store, hash-verified

258 return normalized_audio
259
260def audio_prepare_multi(left_path, right_path, audio_type, sample_rate=16000):
261 if not (left_path=='None' or right_path=='None'):
262 human_speech_array1 = audio_prepare_single(left_path)
263 human_speech_array2 = audio_prepare_single(right_path)
264 elif left_path=='None':
265 human_speech_array2 = audio_prepare_single(right_path)
266 human_speech_array1 = np.zeros(human_speech_array2.shape[0])
267 elif right_path=='None':
268 human_speech_array1 = audio_prepare_single(left_path)
269 human_speech_array2 = np.zeros(human_speech_array1.shape[0])
270
271 if audio_type=='para':
272 new_human_speech1 = human_speech_array1
273 new_human_speech2 = human_speech_array2
274 elif audio_type=='add':
275 new_human_speech1 = np.concatenate([human_speech_array1[: human_speech_array1.shape[0]], np.zeros(human_speech_array2.shape[0])])
276 new_human_speech2 = np.concatenate([np.zeros(human_speech_array1.shape[0]), human_speech_array2[:human_speech_array2.shape[0]]])
277 sum_human_speechs = new_human_speech1 + new_human_speech2
278 return new_human_speech1, new_human_speech2, sum_human_speechs
279
280def _init_logging(rank):
281 # logging

Callers 1

generate_videoFunction · 0.70

Calls 1

audio_prepare_singleFunction · 0.70

Tested by

no test coverage detected