-
Notifications
You must be signed in to change notification settings - Fork 274
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
Crash when evaluating a particular recording #104
Comments
It does the same thing when I drop that file onto https://basicpitch.spotify.com/ |
Hi @paulrosen , can you provide the audio that you're using? In the future, please use basic-pitch-ts for issues related to the typescript library. |
The audio is here: https://production--endearing-hamster-0de147.netlify.app/audio/paul_001.mp3 (With some experimenting, I found that if I shorten the mp3 just slightly it works fine.) |
Thanks! Should I close the issue? |
Well, it would be nice if the original audio worked. I will be submitting random audio so it will fail periodically. What my workaround looks like is:
The drawback of that is:
|
Also, I've tried about 30 recordings so far and 3 of them failed like this, so this isn't a particularly rare case. |
If you change the encoding or resample the file does it still fail? Also has it always been files of this length? |
I just tried resampling the file to 22050Hz and 44100Hz and converting the file to ogg. I'll take a deeper look. |
Note, you could alternatively add 0's to the audio instead of removing the audio. That works at the minimum, but doesn't admittedly solve the root cause. |
All the files tend to be different lengths. I didn't see any pattern having to do with file length. Adding zeros is a better idea for a workaround, thanks! |
Here's another example: https://production--endearing-hamster-0de147.netlify.app/audio/mBpJ9URFpMuTXg1HuOaG.mp3 |
Is there any progress on this? Is there anything I can do to help? I don't know anything about tensorflow so I'm not sure if I could get up to speed. |
No progress. I've been a bit busy on #100 and admittedly forgot about this issue. Hopefully, I can get to this issue in a week or two. I do wonder if tfjs has been updated with a fix since you posted this issue. I can check sometime next week. |
This sort of issue tends to be an edge case for whenever an audio file is chunked up and processed that way. Most likely, some chunk (probably a trailing chunk) is too small for some part of the code. This is why it doesn't have to do with any specific file length, but instead has to do with multiples of some chunk length with a tail chunk that's too small. If I catch it I'll see what I can do as well. |
I have incorporated
"@spotify/basic-pitch": "1.0.1"
into my website.I'm getting good results from most of my test files, but this one particular file crashes:
https://production--endearing-hamster-0de147.netlify.app/audio/paul_001.mp3
(Note that this URL is good for a while but will eventually go away.)In the console I see:
Then it throws the following error:
Thanks for this amazing library!
The text was updated successfully, but these errors were encountered: