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

Duration and samples throw error on WAVE file with no sub-chunks #13

Merged
merged 3 commits into from Mar 30, 2016

Conversation

joshaidan
Copy link
Contributor

I noticed when using WaveInfo on WAVE valid wave files with no data (or sub-chunks) that calling duration or samples would throw the following error:

     NoMethodError:
       undefined method `/' for nil:NilClass

I've created two tests to catch this error, and submitted a possible fix for the problem. Instead of throwing an error, my proposed changes will return zero instead. Also, I added a few checks to prevent divide by zero.

@njh njh merged commit 8362019 into njh:master Mar 30, 2016
@njh
Copy link
Owner

njh commented Mar 30, 2016

Looks great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants