1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-12-24 04:39:51 +05:30

bytebeat-render.js: use different lastCorrectSample values for different audio types

This commit is contained in:
Intel A80486DX2-66 2024-07-13 15:41:38 +03:00
parent 7fec8bf0c5
commit 0df2f8f4a0
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -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)