kahst/BirdNET-Analyzer

Error: sound file does not exist (except it does)

Closed this issue · 4 comments

Describe the bug
After selecting the file to analyse, click analyse, get error.
The GUI can play my recording just fine, but attempt to analyse results in error.

To Reproduce
Steps to reproduce the behavior:
For the GUI:

  1. Click "Click to Upload"
  2. Click "Analyze"
  3. Get the following error: (note that the temp file that the program complaints about not existing actually exists, and visible in explorer
    birdnet error
    )

[2024-09-10 13:06:46]
Traceback (most recent call last):
File "librosa\core\audio.py", line 743, in get_duration
File "soundfile.py", line 467, in info
File "soundfile.py", line 412, in init
File "soundfile.py", line 658, in init
File "soundfile.py", line 1216, in _open
soundfile.LibsndfileError: Error opening 'C:\Users\yueliu\AppData\Local\Temp\gradio\efa48a4c2d5fe368ee7ebfdf7c83b9f0683f1cf07ecf153fd48a984cd655d060\tmp.mp3': File does not exist or is not a regular file (possibly a pipe?).

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "analyze.py", line 483, in analyzeFile
File "audio.py", line 41, in getAudioFileLength
File "librosa\util\decorators.py", line 88, in inner_f
File "librosa\core\audio.py", line 745, in get_duration
File "audioread_init_.py", line 132, in audio_open
audioread.exceptions.NoBackendError

Expected behavior
The app should analyze the file without error.

Desktop (please complete the following information):

  • OS: Win10

Additional context
Example sound file atatched, but this happens with all recordings I have
tmp.zip

Hi,
with your file i also encounter this issue, although other files can be analyzed without problems.
I also tried opening your file in audacity and raven, which also can't open it.
Audacity shows "incorrect filetype" as error and also when running the analyzer from code the console shows the following error: "Giving up searching valid MPEG header after 65536 bytes of junk".
To me it looks like the file is corrupt, but it is weird because the GUI and also the regular windows mediaplayer can play it.

May i ask what you used to create your recordings?

And can you analyze the example file from the repo? https://github.com/kahst/BirdNET-Analyzer/blob/main/example/soundscape.wav

The example got a wrong extension. This is no MP3 file, but an MP4 container including AAC coded audio. Perhaps renaming your file to tmp.mp4 or tmp.m4a might solve the problem (but I'm not sure about supported filetypes).

And can you analyze the example file from the repo? https://github.com/kahst/BirdNET-Analyzer/blob/main/example/soundscape.wav

That worked just fine

The example got a wrong extension. This is no MP3 file, but an MP4 container including AAC coded audio. Perhaps renaming your file to tmp.mp4 or tmp.m4a might solve the problem (but I'm not sure about supported filetypes).

Renaming the file did not solve the problem, but I did find a work-around by using VLC to convert my file to an actual mp3 file. Then BirdNET works fine on the converted file.

thanks @MacJudge for figuring this out!

i think there is not much more we can do so i will close this issue.