feat(alerts): sound byte under Built-in video, and alert audio that reaches the device

Creator request: a sound-byte browse + label under Built-in video, with an option to loop the
sound while the clip plays. The video itself is always one pass to completion.

- Source gains AlertAudioPath and AlertAudioLoop, persisted (column + migration + INSERT +
  SELECT + reader, the whole chain — that chain is where the blur crashed once).
- The sound byte plays through MediaPlayer on the default output device; MediaEnded re-seeks to
  zero while looping, and StopClip kills it so a tail cannot bleed into the next alert.
- The clip's OWN soundtrack moved off the mixer and onto the device as well
  (Services/Audio/AlertAudioOutput: one WaveOutEvent + buffered float provider).

Why the move: the creator asked that alert audio — the clip's track or the added sound byte —
appear in the desktop sound bar. Only audio that reaches the default device is picked up by the
WASAPI loopback that feeds both the meter and the stream. The old EnqueueAlertAudio route put the
sound in the stream but left the meter flat and the room silent.

Tests: the sound byte and its loop flag round-trip through SQLite, and a fresh alert layer starts
with no sound byte and no loop. Release 0 warnings.
This commit is contained in:
2026-11-01 14:13:57 -08:00
parent 46d12e5873
commit b00bf48b9d
11 changed files with 287 additions and 5 deletions
+19
View File
@@ -187,6 +187,25 @@ public partial class MainViewModel : ViewModelBase
box.AlertUseDefaultVideo = false;
}
private void BrowseAlertAudio(Source? box)
{
if (box == null || box.Type != SourceType.AlertBox) return;
var dialog = new OpenFileDialog
{
Title = "Choose the alert sound byte",
Filter = "Audio files (*.mp3;*.wav;*.m4a;*.aac;*.ogg)|*.mp3;*.wav;*.m4a;*.aac;*.ogg|All files (*.*)|*.*"
};
if (dialog.ShowDialog() != true) return;
box.AlertAudioPath = dialog.FileName;
}
private void ClearAlertAudio(Source? box)
{
if (box == null || box.Type != SourceType.AlertBox) return;
box.AlertAudioPath = null;
box.AlertAudioLoop = false;
}
private void ResetAlertVideo(Source? box)
{
if (box == null || box.Type != SourceType.AlertBox) return;