librosa

librosa.load: file not found error on loading a file

孤者浪人 提交于 2019-11-29 18:05:14
I am trying to use librosa to analyze .wav files. I started with creating a list which stores the names of all the .wav files it detected. data_dir = '/Users/raghav/Desktop/FSU/summer research' audio_file = glob(data_dir + '/*.wav') I can see the names of all the files in the list 'audio_file'. But when I load any of the audio file, it gives me file not found error. audio, sfreq = lr.load(audio_file[0]) error output: Traceback (most recent call last): File "read_audio.py", line 10, in <module> audio, sfreq = lr.load(audio_file[1]) File "/usr/local/lib/python3.7/site-packages/librosa/core/audio

running librosa & numba on raspberry pi 3

夙愿已清 提交于 2019-11-28 12:50:29
I am trying to run librosa on my raspberry pi 3. After hours of searching through the internet I was finally able to install it but it still throws an error when I try to import it. First, I had problems to install the dependency llvmlite. I finally installed it with the following code: conda install -c numba llvmlite I use python 3.4 build with miniconda. After llvmlite was installed I was able to install librosa with pip (not possible with conda) pi@raspberrypi:~ $ pip install librosa Collecting librosa Using cached https://www.piwheels.hostedpi.com/simple/librosa/librosa- 0.5.1-py3-none-any

How can I save a Librosa spectrogram plot as a specific sized image?

本秂侑毒 提交于 2019-11-28 10:02:44
问题 So I'm wanting to feed spectrogram images to a convolutional neural network as an attempt to classify various sounds. I want each image to be exactly 384x128 pixels. However, when I actually save the image it is only 297x98. Here's my code: def save_spectrogram(num): dpi = 128 x_pixels = 384 y_pixels = 128 samples, sr = load_wave(num) stft = np.absolute(librosa.stft(samples)) db = librosa.amplitude_to_db(stft, ref=np.max) fig = plt.figure(figsize=(x_pixels//dpi, y_pixels//dpi), dpi=dpi,

running librosa & numba on raspberry pi 3

徘徊边缘 提交于 2019-11-26 21:58:42
问题 I am trying to run librosa on my raspberry pi 3. After hours of searching through the internet I was finally able to install it but it still throws an error when I try to import it. First, I had problems to install the dependency llvmlite. I finally installed it with the following code: conda install -c numba llvmlite I use python 3.4 build with miniconda. After llvmlite was installed I was able to install librosa with pip (not possible with conda) pi@raspberrypi:~ $ pip install librosa