diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-20 17:05:52 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-20 17:05:52 -0500 |
| commit | fb3ec828f6da432c0cea2c8df465397d6a58093e (patch) | |
| tree | 1dde1815b943032055bfbdcfb49aa2505c5aec00 | |
| parent | bfaff369b3592826bc7d4e5aaba7161815733eea (diff) | |
Fix sign handling on integer wave file read
| -rw-r--r-- | wav.bqn | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -66,7 +66,8 @@ _audioConvert β { _withInv_ β {F _π£_ G: {π:Fπ© ; πβΌ:Gπ©}} # Convert π-byte sequences to ints _int β { - b β 256 β (+β(bβΈΓ)ΛββββΏπβ₯β’) _withInv_ (β₯βββ>b|ββΓ·βbβ(βπ)) + b β 256 + (+β(bβΈΓ)ΛΛβ(-(bΓ·2)β€Β―1βΈβ)Β·βββΏπβ₯β’) _withInv_ (β₯βββ>b|ββΓ·βbβ(βπ)) } # Convert int to float _float β {eβΏmβΏbβπ # exponent and mantissa length in bits; bias |
