Files
XQKqueue/.project-docs/10-decisions/adr-002-embedded-audio-announcements.md

40 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ADR-002: Embedded audio announcements
## Status
Accepted
## Date
2026-08-12
## Context
System speech synthesis was absent or inconsistent on the target display devices. A first embedded eSpeak asset set produced unintelligible Mandarin. The repository already contained a prior Mandarin queue-announcement WAV set that the user confirmed was the intended project audio.
## Decision
Package the projects legacy Mandarin prompt, digit, range, and suffix fragments in the APK. Parse and validate PCM WAV assets, compose the number or range locally, and stream each announcement three times using `AudioTrack` with media usage and transient audio focus. Do not announce the project name. Do not depend on system TTS.
## Rationale
Deterministic bundled PCM avoids browser autoplay and installed-voice dependencies while allowing the server to continue sending ordinary snapshot text and batch data.
## Consequences
- The APK contains and tests exactly 13 WAV resources.
- The player must own FIFO ordering, cancellation, focus, and native track lifecycle safely.
- The original generator, speaker, and separate redistribution license for the historical WAVs are not recorded; confirm ownership before distribution outside the project's authorized deployment scope.
- Audio routing and intelligibility remain target-device acceptance items.
## Supersedes
- Android system TTS announcements.
- The rejected eSpeak-generated Mandarin assets.
## Related
- `android/app/src/main/java/cn/nianxx/queue/display/QueueAnnouncementPlayer.java`
- `android/app/src/main/java/cn/nianxx/queue/display/EmbeddedWavComposer.java`
- `.project-docs/50-evidence/topics/20260811-native-display-f2456ea9__embedded-audio-assets.md`