I am trying to load a .wav
file in Python using librosa library. Let's assume my code is as simple as:
import librosa
import numpy as np
pcm_data, spl_rate = librosa.core.load(resource_file, sr=None)
In general it does work, however I am experiencing strange quantization problems when reading audio files with amplitude of less than 1e-5. I need some really low amplitude noise samples for my project (VERY little ambient noise, yet not complete silence).
For instance, when I generate white noise of amplitude 0.00001
in Audacity, its waveform is visible in Audacity preview when fully magnified. It is also visible after exporting the waveform as 32bit float and re-importing it to empty Audacity project. However, when I read that file using code presented above, np.max(np.abs(pcm_data))
is 0.0
. Did I just reach limits of Python in this matter? How do I read my data (without pre-scaling and rescaling in runtime)?