Zeal voice -- speech quality and regression follow-up, 2026-10-12
================================================================

Outcome
-------
Public Fortnite and Warzone audio was retrieved. The new speech QA found and
fixed two production defects missed by steady-tone/transport tests:

1. Speex's per-tick automatic delay reduction discarded whole speech
   frames after voice activation released its preroll burst. Disable this
   reduction: missing-packet handling can still expand buffering, and existing
   talkspurt/stall/backlog resets bound accumulated delay. This preserves speech
   at the cost of retaining some extra buffering within a speaking burst.

2. The receiver reset its decoder after long silence while the sender retained
   its encoder history. Quiet restarts could produce excessive amplitude.
   Reset the encoder on each marked activation, carry the authenticated start
   marker through the jitter buffer, and reset the decoder when that particular
   packet plays. Resetting on arrival would corrupt earlier queued speech when
   packets arrive out of order.

Regression tests now compare every sample of 200 received frames against the
sequential codec reference after a five-packet preroll burst. A second case
restarts the codec while previous frames are still buffered; both must remain
continuous. These test audio contents, not just nonzero output or packet counts.

Online game examples
-------------------
Retrieved fixed 60-120 second excerpts from these creator uploads:
  Fortnite: https://www.youtube.com/watch?v=eXRCbD0pzTs
  Warzone:  https://www.youtube.com/watch?v=_fxT1i_5wXQ

The highest available non-DRC Opus audio variant was selected; the Fortnite
retrieval initially selected a DRC variant and was replaced before analysis.
Source upload dates, codec, duration and excerpt hashes are in online-examples.json.
The decoded stereo excerpts are retained locally at:
  /tmp/iw4x-voice-quality-20261012/fortnite-excerpt.wav
  /tmp/iw4x-voice-quality-20261012/warzone-excerpt.wav
They are not redistributed in the installer or source/player bundle.

These are composite gameplay recordings, with unknown microphones, voice
settings, source levels, stream processing and upload compression. They have
no matching clean microphone reference or synchronized send/receive timestamps.
They provide listening examples, not a valid numerical rank of the games'
voice systems. No Fortnite/CoD/Discord MOS or superiority claim was calculated.
No human listener preference results were collected in this pass.

Repeatable speech experiment
---------------------------
Clean public input comes from the official Opus demonstration's uncompressed
speech WAV (10.8 seconds, converted to mono PCM16/48 kHz):
  https://opus-codec.org/examples/
  https://media.xiph.org/opus/samples/examples/speech_orig.wav
Provenance/hash: reference-source.json. This is one speech fixture, not a
representative multi-speaker/headset corpus. Synthetic colored background noise
is added deterministically in the noisy cases; it is not a real noisy-room test.

New voice_qa quality command exercises the production capture gate, optional
RNNoise, Opus encoder, receive jitter/decoder and mixer. A simulated clock gives
20 ms one-way delivery plus the specified jitter, random loss or loss burst.
It opens no microphone, playback device or real network. Device/SRTP/relay
checks are separate. WAV output retains the original timeline and trailing
silence; analysis applies one global alignment, not per-syllable realignment.

tests/voice_quality.py creates and evaluates 12 profiles. Optional analysis
dependency versions are recorded in qa-tools.json. Reproduce with:
  python tests/voice_quality.py --voice-qa /path/to/voice_qa \
    --reference /path/to/mono-48k-speech.wav --output /path/to/results

STOI and extended STOI are intelligibility screening metrics, not MOS, a
percentage of understood words, fidelity certification or a human naturalness
score. Waveform SNR likewise must not be advertised as perceived quality.
Primary metric reference: https://github.com/mpariente/pystoi

Selected final results (STOI; larger is better within this fixture):
  Normal, no impairment:                   0.999219
  Normal, 0-25 ms jitter, no loss:          0.999219
  Normal, 1% loss plus jitter:              0.982547
  Normal, 3% loss plus jitter:              0.958433
  Normal, 5% loss plus jitter:              0.933873
  Normal, 100 ms loss burst plus jitter:    0.978355
  Quiet, 3% input amplitude:               0.999147
  Natural with synthetic 20 dB SNR noise:  0.967566
  RNNoise with that same noise:            0.975291

The quiet fixture improved from 0.950283 to 0.999147. On the unscaled original
fixture, disabling frame removal improved aligned waveform SNR from 8.18 to
27.79 dB and STOI from 0.982702 to 0.999250. Its alignment changed from 56.5 to
106.5 ms: the earlier stream had dropped time from its beginning. These are
offline delays, not measured hardware mouth-to-ear latency.

The deliberately very faint input (1% amplitude) originally produced a peak
of 0.077148 despite its input peak being only 0.006989. After synchronized
codec restart, the output peak is 0.006866. This removes the roughly elevenfold
spurious peak. At the default -58 dBFS activation threshold this extremely
faint fixture still retains only 87.60% of input energy and scores 0.704724:
the microphone gain or sensitivity needs adjustment. No automatic gain or
automatic microphone calibration has been added or claimed.

All 12 final profiles produced finite audio with no full-scale output samples.
Normal speech retained 100% of input energy through the gate; the quiet fixture
retained 99.991%. RNNoise slightly changes clean speech (STOI 0.993364), supporting
retaining Natural as the default and noise suppression as an explicit option.
No claim of transparent packet loss is made.

Native Windows and regression evidence
--------------------------------------
Windows x86 MSVC build and all three CTest groups pass, including the two new
speech-continuity/restart checks. Six file-based speech profiles also ran in
the native Windows executable: clean, jitter, 3% loss, quiet, very quiet, and
noise suppression with noise. Their screening scores and output peaks match
Linux at reported precision. See windows-speech.json and windows-build-tests.txt.

Linux also passes all three CTest groups. All 51 Python tests pass with the
voice dependencies installed, including eight authenticated speakers routed
only to their three teammates. An initial system-Python run skipped nine voice
tests; the recorded result uses the proper environment and has no skips.

The eight-stream 10-minute simulated clock tests at +/-200 ppm and 1% loss
pass on the final Linux and native Windows builds with zero late packet rejects.
+200 ppm has eight initial resyncs;
-200 ppm has sixteen total, i.e. one additional bounded resync per continuously
active stream. This is a timing-policy tradeoff, not uninterrupted clock-drift
correction: the receiver does not implement time stretching. Normal pauses can
release excess buffering; continuous open microphones remain a qualification
case. See linux-soak.txt and windows-soak.txt.

This pass did not repeat the previous eight actual game clients, physical
device/hotplug tests or a full match. Those earlier results apply to the
previous DLL and are preserved in ../voice-windows-20261012/REPORT.txt.
No physical microphone was opened and no private conversation was recorded.
Hardware latency, real noisy headsets, WAN/VPS behavior and blind human
comparison with Discord/other games remain unqualified.

Build and delivery
------------------
DLL SHA256:
  f809cad473d39e1237b56edf7c2590b1780e43a4f3452dd0296b60df4355a470
Installer 1.21 SHA256:
  abb13fc7cbdd8c8ab45cda3034ad542fb8088708fb52d14c2953890ca09e2820
Menu remains:
  7405baa98bea5da2cd042abe4eefd7809d87dd92538bd36187bb7bcd0121ad24

The build retains the earlier Win32 macro-redefinition warning and installer
unused-variable warning; neither is a new functional failure.
Deployment/installer verification is recorded in deployment.json and
windows-installer.txt. The new local v3.8 player bundle includes matching
installer, DLL, complete corresponding source and QA evidence. Earlier player
bundles and the prior installed DLL backups are preserved. Nothing was published.
