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

Doesn't handle 0 length audio files gracfully #20

Closed
EvansMike opened this issue Oct 8, 2023 · 2 comments · Fixed by #39
Closed

Doesn't handle 0 length audio files gracfully #20

EvansMike opened this issue Oct 8, 2023 · 2 comments · Fixed by #39
Assignees
Labels
bug Something isn't working

Comments

@EvansMike
Copy link

EvansMike commented Oct 8, 2023

Some of the files my AudioMoth recorded were empty causing the output below.

 0 run/media/mikee/boot/20231007_234400.WAV
 /home/mikee/.local/lib/python3.11/site-packages/batdetect2/utils/audio_utils.py:147: UserWarning: PySoundFile failed.  Trying audioread instead.
 audio_raw, sampling_rate = librosa.load(
 /home/mikee/.local/lib/python3.11/site-packages/librosa/core/audio.py:183: FutureWarning:  librosa.core.audio.__audioread_load
 Deprecated as of librosa version 0.10.0.
 It will be removed in librosa version 1.0.
 y, sr_native = __audioread_load(path, offset, duration, dtype)

 Aborted!

I simply removed the empty files to fix the issue but maybe these should be handled gracefully within batdetect2?

@macaodha
Copy link
Owner

macaodha commented Oct 8, 2023

Thanks for the heads up. Can you share an example of a file that broke it. You can email it to me if too big to link here. Email address is on my website. Thanks!

@EvansMike
Copy link
Author

EvansMike commented Oct 8, 2023

Any empty file with the .wav extension. As in linux :
touch bat.wav
I suspect that the SD card ran out of space and AudioMoth kept making files that were truncated to zero bytes.

Edit: I've added a zero length file.

@mbsantiago mbsantiago self-assigned this May 14, 2024
@mbsantiago mbsantiago added the bug Something isn't working label May 14, 2024
@mbsantiago mbsantiago linked a pull request Nov 11, 2024 that will close this issue
mbsantiago added a commit that referenced this issue Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants