-
Notifications
You must be signed in to change notification settings - Fork 202
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
Writing a loop to analyze hundreds of wav files in one folder #12
Comments
@lenawarbler |
Hi there! Similar to the comment above, we encountered the same problem, so we implemented the ability to recursively go through folders given a path on our fork here: https://github.com/UCSD-E4E/BirdNET-Lite |
@JacobGlennAyers It is probably an easy fix, but I have very limited experience with any of this. Any help getting this to run on my PC would be much appreciated! |
Hi there, in Windows, the directories (folders) have paths like this with \
characters, while linux, and MacOS use / characters. So, if you are working
with windows, change "example/important/path" to "example\\important\\path"
…On Thu, Feb 10, 2022, 1:29 PM m1sterjay ***@***.***> wrote:
@JacobGlennAyers <https://github.com/JacobGlennAyers>
Hi Jacob. Thanks for creating this. I successfully get this to run through
audio files on folders on my mac, but when I run it on my PC running
Windows 11, I get a file read error: "Error in processing file:
C:\Users\johan\BirdNET-Lite-batch-2\example\file2.wav"
It is probably an easy fix, but I have very limited experience with any of
this. Any help getting this to run on my PC would be much appreciated!
—
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6J6GBOM57HKKSARJVQ6ETU2QU25ANCNFSM5F6L7WJA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@JacobGlennAyers Thanks for getting back to me. Edit: I resolved this by editing the analyze.py script so that all of the '/' characters in the relevant section were replaced with double backslash and it works now. Thanks again, this will save me a lot of time! |
@m1sterjay Thanks for finding a bug, we made a quick fix to the repo using the builtin python os library (automagically handles '\' and '/') in order to make it more platform independent. |
Hi BirdNET fans. I recently switched from BirdNET to BirdNET-Lite and noticed the input file requirements are slightly different.
With the original version, I could specify an input folder ('/mnt/c/folder') and BirdNET would set to work analyzing the hundreds of wav files within. However BirdNET-Lite seems to require a specific file name to work ('/mnt/c/folder/audiofile.wav').
What is appropriate syntax for analyzing 1000 wav files inside one folder? (I am using Ubuntu for Windows).
Here is pseudo-code for what I am trying to do:
for filename in /mnt/c/folder/*.wav; do
python3 analyze.py --i /mnt/c/folder/"$filename" --o /mnt/c/folder/"$filename".csv
done
Perhaps there is an easier way I am not seeing... I am new to Linux! I appreciate your help!
Update: It was easier than I thought! This code will analyze all wavs in a folder and save a csv with the same name
for filename in /mnt/c/folder/*.wav; do
python3 analyze.py --i $filename --o "$filename.csv"
done
The text was updated successfully, but these errors were encountered: