Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wav/Mp3/Raw audio files exported from Audacity or recorded using arecord are not recgnized as valid format #119

Open
Anamtya2024 opened this issue Oct 10, 2024 · 1 comment

Comments

@Anamtya2024
Copy link

getting this error when i try to upload wav files recorded using audacity OR recorded from command line using arecord

arecord -v -D hw:0 -t wav -f S16_LE -c 2 -r 16000 -C -d 10 card.wav

Error : No module named 'resampy'

Out put of program:

Labels loaded.
load model True
Model loaded.
Labels loaded.
load_species_list_model
Meta model loaded.
read_audio_data
No module named 'resampy'

This error is lazily reported, having originally occured in
File /usr/local/lib/python3.10/dist-packages/librosa/core/audio.py, line 33, in

----> resampy = lazy.load("resampy")


ModuleNotFoundError Traceback (most recent call last)

/usr/local/lib/python3.10/dist-packages/birdnetlib/main.py in read_audio_data(self)
310 try:
--> 311 self.ndarray, rate = librosa.load(
312 self.path, sr=SAMPLE_RATE, mono=True, res_type="kaiser_fast"

5 frames

ModuleNotFoundError: No module named 'resampy'

This error is lazily reported, having originally occured in
File /usr/local/lib/python3.10/dist-packages/librosa/core/audio.py, line 33, in

----> resampy = lazy.load("resampy")

During handling of the above exception, another exception occurred:

AudioFormatError Traceback (most recent call last)

/usr/local/lib/python3.10/dist-packages/birdnetlib/main.py in read_audio_data(self)
321 except BaseException as e:
322 print(e)
--> 323 raise AudioFormatError("Generic audio read error occurred from librosa.")
324
325 self.process_audio_data(rate)

AudioFormatError: Generic audio read error occurred from librosa.

@joeweiss
Copy link
Owner

Hi @Anamtya2024. That error indicates that the library resampy hasn't been loaded. That library is typically installed along with librosa.

You can try to install it manually with pip by running the following command:
pip install resampy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants