aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wav.bqn3
1 files changed, 2 insertions, 1 deletions
diff --git a/wav.bqn b/wav.bqn
index 5ac83aa..b35362f 100644
--- a/wav.bqn
+++ b/wav.bqn
@@ -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