feat: 打通音频整链,被控端送 PCM、主控端 waveOut 播放

- android_receiver:音频改为直接送 PCM16(FLAG_PCM=0x80),不再走 Opus 编码
  (仓库未打包 libopus,MediaCodec Opus 多数设备不可用,主控端也无解码器)
- rust_core:新增 media/audio 播放队列(上限 1 秒、按帧对齐切分、超出丢最旧)
- rust_core:音频分片校验 MAC 后按 FLAG_PCM 入队,旧 Opus 包明确丢弃并记日志
- rust_core:新增 ttstd_audio_next / ttstd_audio_pending / ttstd_audio_stats
- flutter_sender:新增 audio_player(waveOut)轮询播放队列,有数据才打开设备、静音 3 秒自动关闭
- docs:README 增加音频链路章节与 PCM 取舍,AGENTS 记录 FLAG_PCM 约定
This commit is contained in:
tongtong committed 2026-11-27 21:15:17 +08:00
1 parent c6925d0890
commit 37b2cff82b
14 files changed
+468 -19

No files matched your search

@@ -0,0 +1,12 @@
#ifndef RUNNER_AUDIO_PLAYER_H_
#define RUNNER_AUDIO_PLAYER_H_
// 播放 Rust Core 音频队列里的 PCM(48 kHz / 双声道 / 16 bit 小端)。
//
// 和视频纹理一样由 runner 自己起线程轮询 FFI 队列:
// - 有数据才打开 waveOut,静音 3 秒自动关闭,不长期占用音频设备;
// - 不依赖 Dart 侧参与,投屏开始/结束无需额外通道。
void StartAudioPlayer();
void StopAudioPlayer();
#endif // RUNNER_AUDIO_PLAYER_H_