I am using librosa to resample the audio data, like below:
import librosa
filename = "/home/.../example.mp3"
audio, original_samplerate = librosa.load(filename)
target_samplerate = 24000
new_audio = librosa.resample(audio,original_samplerate ,target_samplerate ,res_type='sinc_fastest')
This code works in my local linux system. However, when I deploy such code to the Azure function, it outputs Error: OSError: sndfile library not found Stack
The reason should be the librosa.resample function needs two C build Libs: Libsndfile and Libsamplerate. I can install them on my local linux system:
For Libsndfile:
sudo apt-get libsndfile1
sudo apt-get libsndfile-dev
For Libsamplerate: I first download the file from github: https://github.com/libsndfile/libsamplerate
Then just follow the install instruction:
./configure
make
make check
make install
But how to install these two Libs on Azure function?