-
Notifications
You must be signed in to change notification settings - Fork 0
27 panda parsing #78
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
Draft
kgarwoodsdzwa
wants to merge
14
commits into
dev
Choose a base branch
from
27_panda_parsing
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
27 panda parsing #78
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
needs some work to go through numerous sound files and give better resulting filenames. but this script takes a sound file and then calculates the rms across a certain number of frames you tell it the size and hop for, giving you an array of rms values. It then calculates the average rms, and multiplies it by 1.5 and creates 3 second segments of audio centered around the frame that exceeded the rms threshold. it will not create overlapping segments. there's definitely some potential issues with this but for now seems to be able to create segments based on the relative loudness of the whole sample. for example it hasn't had to handle creating a segment where the values that exceed the threshold equate for more than the specified 3s for clip creation.
displays 2 charts with the same timestep, the top one is the rms for each of your specified frame lengths and the bottom is a mel spectrogram. you can see the correlation between the two and it can be helpful
beginnings of way to run multiple files through this process. needs to create different filenames to differentiate the original wavs still but then it should be gravy
filenames were assuming 1 wav file before, now it writes the name of the clip with the original wav file in the filename so its clearer, it also successfully usilizes the proper specified outpath to save the files
there is one error of catching too broad an except but im going to ignore it for right now because it helps with debugging
the last catch for making the final segment in a wav file was creating a new right_index to stop the recording, when it should have just been using the stop_index so that it wouldn't go out of bounds. also made a sub function to make the rms array to clean up the code a bit
i want to ultimately put this in the whoot package so it shouldn't necessarily be called main
adding the frame_length, the hop_length, and desired clip size to the config file to easily adjust the values
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tools to attempt to isolate significant events in a wav file for unlabeled audio. Visualize the RMS and Mel-spectrogram for a wav file, or extract segments that exceed the average RMS for a wav file to inspect closer or label. Tested on one week deployment of passive acoustic recorders at panda site and was able to determine a repeated feeding time where panda chewing can be heard.