tessel/audio-vs1053b — pull request #37 by nw (2014-11-19 02:16:12+00:00)
Title: Fix volume

This PR addresses tessel/audio-vs1053b#36.

The api is now consistent with the documentation.

0 = lowest volume level (-127dB) and 1 = highest volume level (0dB).

* A value above 1 will be set to 1 and below 0 set to 0.
* All values are rounded to the nearest half decimal per hardware specs.
* exposed a private method `_normalizeVolume` for code reduction and test suite.

I did run into the following issues:

* test suite was a little hard to run. Resorted to `tessel run test/test.js` so I could see the output. It passes everything but hangs at the end.
* In the argument sniffing I ran into issue with isNaN return `false` for everything. I skipped running runtime tests and used a `typeof` check instead.
* I caught some errors with the `setInput` method in the docs and examples. Not really part of this PR. I can break out if need be.