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

merged 3 commits into from Mar 30, 2016


2 participants

joshaidan commented Mar 30, 2016

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:

       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

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error

This comment has been minimized.

Show comment
Hide comment

njh Mar 30, 2016


Looks great, thanks!


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