Initial audio support

This commit is contained in:
2026-05-04 14:32:29 +10:00
parent 44316b29c2
commit f836c53d10
17 changed files with 977 additions and 10 deletions

View File

@@ -19,6 +19,7 @@ function App() {
const performance = appState?.performance ?? {};
const runtime = appState?.runtime ?? {};
const video = appState?.video ?? {};
const audio = appState?.audio ?? {};
const app = appState?.app ?? {};
const stackPresets = appState?.stackPresets ?? [];
@@ -67,7 +68,7 @@ function App() {
</header>
<section className="dashboard-grid">
<StatusPanels app={app} performance={performance} runtime={runtime} video={video} />
<StatusPanels app={app} audio={audio} performance={performance} runtime={runtime} video={video} />
<StackPresetToolbar
presetName={presetName}
selectedPresetName={selectedPresetName}

View File

@@ -4,7 +4,7 @@ function formatNumber(value, digits = 3) {
return Number(value ?? 0).toFixed(digits);
}
export function StatusPanels({ app, performance, runtime, video }) {
export function StatusPanels({ app, audio, performance, runtime, video }) {
return (
<>
<div className="panel panel--runtime">
@@ -36,6 +36,21 @@ export function StatusPanels({ app, performance, runtime, video }) {
/>
</div>
<div className="panel panel--audio">
<h2>Audio</h2>
<KvList
values={[
["Enabled", audio.enabled ? "On" : "Off"],
["Sample Rate", `${app.audioSampleRate || 0} Hz`],
["Channels", `${app.audioChannelCount || 0}`],
["Buffered", `${audio.bufferedSampleFrames || 0} samples`],
["Underruns", `${audio.underrunCount || 0}`],
["RMS L/R", `${formatNumber(audio.rms?.[0], 3)} / ${formatNumber(audio.rms?.[1], 3)}`],
["Peak L/R", `${formatNumber(audio.peak?.[0], 3)} / ${formatNumber(audio.peak?.[1], 3)}`],
]}
/>
</div>
<div className="panel panel--compiler">
<h2>Compiler</h2>
<pre>{runtime.compileMessage || "No compiler output."}</pre>