Correct audio metering and realtime displays
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import vm from 'node:vm';
|
||||
import { getRtwCenters } from '../www/core/rtw_centers.js';
|
||||
import { selectLocalRtwPacket } from '../www/views/realtime.js';
|
||||
|
||||
const source = fs.readFileSync(new URL('../www/core/audio.js', import.meta.url), 'utf8');
|
||||
const functionSource = source.match(/export function buildRtaRuntimeConfig[\s\S]*?\n\}/)?.[0];
|
||||
@@ -71,4 +73,18 @@ assert.equal(selectionContext.CONFIG.RTA_BAR_LAYOUT, 'rtw');
|
||||
assert.equal(selectionContext.applyRtaBpoSelection('1_3'), '1_3');
|
||||
assert.equal(selectionContext.CONFIG.RTA_BAR_LAYOUT, 'rtw');
|
||||
|
||||
const twelfthCenters = getRtwCenters('1_12');
|
||||
const staleTwelfthPacket = {
|
||||
engine: 'iir',
|
||||
bpo: '1_12',
|
||||
centers: twelfthCenters,
|
||||
bands_avg: twelfthCenters.map((_, index) => index),
|
||||
bands_peak: twelfthCenters.map((_, index) => index + 1000),
|
||||
};
|
||||
const selectedSixth = selectLocalRtwPacket(staleTwelfthPacket, '1_6');
|
||||
assert.equal(selectedSixth.bpo, '1_6');
|
||||
assert.equal(selectedSixth.centers.length, getRtwCenters('1_6').length);
|
||||
assert.equal(selectedSixth.bands_avg.length, selectedSixth.centers.length);
|
||||
assert.equal(selectedSixth.bands_peak.length, selectedSixth.centers.length);
|
||||
|
||||
console.log('RTA profile regression tests passed');
|
||||
|
||||
Reference in New Issue
Block a user