node-audio-mixer
Version:
PCM audio mixer with customizable parameters
9 lines (8 loc) • 379 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getValueRange = getValueRange;
function getValueRange(bitDepth, isUnsigned, isFloat) {
const maxValue = isFloat ? 1.0 : (2 ** (isUnsigned ? bitDepth : bitDepth - 1)) - 1;
const minValue = isFloat ? -1.0 : isUnsigned ? 0 : -(maxValue + 1);
return { min: minValue, max: maxValue };
}