(audio_array, sr=16000, lufs=-23)
| 250 | return wav2vec_feature_extractor, audio_encoder |
| 251 | |
| 252 | def loudness_norm(audio_array, sr=16000, lufs=-23): |
| 253 | meter = pyln.Meter(sr) |
| 254 | loudness = meter.integrated_loudness(audio_array) |
| 255 | if abs(loudness) > 100: |
| 256 | return audio_array |
| 257 | normalized_audio = pyln.normalize.loudness(audio_array, loudness, lufs) |
| 258 | return normalized_audio |
| 259 | |
| 260 | def audio_prepare_multi(left_path, right_path, audio_type, sample_rate=16000): |
| 261 | if not (left_path=='None' or right_path=='None'): |
no outgoing calls
no test coverage detected