mirror of
https://gitlab.com/80486DX2-66/gists
synced 2024-12-23 19:29:51 +05:30
bytebeat-render.js: use different lastCorrectSample
values for different audio types
This commit is contained in:
parent
7fec8bf0c5
commit
0df2f8f4a0
@ -76,7 +76,18 @@ const generateAudio = t => {
|
||||
|
||||
const clamp = (a, b, c) => max(min(a, c), b)
|
||||
|
||||
let lastCorrectSample = 127 // FIXME: guessed value
|
||||
let lastCorrectSample
|
||||
switch (SELECTED_TYPE) {
|
||||
case TYPE_BYTEBEAT:
|
||||
lastCorrectSample = 127
|
||||
break;
|
||||
case TYPE_SIGNED_BYTEBEAT:
|
||||
lastCorrectSample = 0
|
||||
break;
|
||||
case TYPE_FLOATBEAT:
|
||||
lastCorrectSample = 0.0
|
||||
break;
|
||||
}
|
||||
|
||||
const constrainValue = sample => {
|
||||
if (isNaN(sample) || sample < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user