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