Download LaViDa/eval/lmms_eval/models/model_utils/audio_processing.py from GuoruiSong/ReVID: direct link, hf CLI and curl.
- Browser
- Download file 268 Bytes
-
https://huggingface.co/GuoruiSong/ReVID/resolve/main/LaViDa/eval/lmms_eval/models/model_utils/audio_processing.py
- Command line
-
hf download hf://GuoruiSong/ReVID/LaViDa/eval/lmms_eval/models/model_utils/audio_processing.py
-
curl -L -o audio_processing.py https://huggingface.co/GuoruiSong/ReVID/resolve/main/LaViDa/eval/lmms_eval/models/model_utils/audio_processing.py
268 Bytes
| import numpy as np | |
| from librosa import resample | |
| def downsample_audio(audio_array: np.ndarray, original_sr: int, target_sr: int) -> np.ndarray: | |
| audio_resample_array = resample(audio_array, orig_sr=original_sr, target_sr=target_sr) | |
| return audio_resample_array | |