(audio_array, sr=16000, lufs=-23)
| 260 | return wav2vec_feature_extractor, audio_encoder |
| 261 | |
| 262 | def loudness_norm(audio_array, sr=16000, lufs=-23): |
| 263 | meter = pyln.Meter(sr) |
| 264 | loudness = meter.integrated_loudness(audio_array) |
| 265 | if abs(loudness) > 100: |
| 266 | return audio_array |
| 267 | normalized_audio = pyln.normalize.loudness(audio_array, loudness, lufs) |
| 268 | return normalized_audio |
| 269 | |
| 270 | def audio_prepare_multi(left_path, right_path, audio_type, sample_rate=16000): |
| 271 | if not (left_path=='None' or right_path=='None'): |
no outgoing calls
no test coverage detected