it0/it0_app/lib/core
hailin e706a4cdc7 fix: enable simultaneous playback + recording in voice call
Root cause: PcmPlayer called openPlayer() without audio session config,
so Android defaulted to earpiece-only mode. When the mic was actively
recording, playback was silently suppressed — the agent's TTS audio was
sent successfully over WebSocket but never reached the speaker.

Changes:

1. PcmPlayer (pcm_player.dart):
   - Added audio_session package for proper audio session management
   - Configure AudioSession with playAndRecord category so mic + speaker
     work simultaneously
   - Set voiceCommunication usage to enable Android hardware AEC (echo
     cancellation) — prevents feedback loops when speaker is active
   - defaultToSpeaker routes output to loudspeaker instead of earpiece
   - Restored setSpeakerOn() method stub (used by UI toggle)

2. AgentCallPage (agent_call_page.dart):
   - Fixed fire-and-forget bug: _pcmPlayer.feed() returns Future but was
     called without await, causing interleaved feedUint8FromStream calls
   - Added _feedChain serializer to guarantee sequential audio feeding

3. Dependencies:
   - Added audio_session package to pubspec.yaml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 06:48:16 -08:00
..
audio fix: enable simultaneous playback + recording in voice call 2026-02-25 06:48:16 -08:00
config feat: 完成 iAgent App 三大功能 + 修复租户上下文 2026-02-23 01:10:52 -08:00
errors feat: 生产级 API 错误处理 — 重试拦截器、友好错误提示、网络监测、WebSocket 退避 2026-02-23 04:01:04 -08:00
network fix: properly close WebSocket with subscription cancel + fire-and-forget 2026-02-25 03:45:43 -08:00
router feat: 生产级 API 错误处理 — 重试拦截器、友好错误提示、网络监测、WebSocket 退避 2026-02-23 04:01:04 -08:00
services feat: 补齐大厂级网络层 — 401并发锁、请求去重、结构化错误日志 2026-02-23 04:05:53 -08:00
tenant Initial commit: IT0 AI-powered server cluster operations platform 2026-02-08 22:54:37 -08:00
theme style: 导航栏去掉蓝色药丸背景,改为图标/文字高亮 2026-02-23 05:09:34 -08:00
utils Initial commit: IT0 AI-powered server cluster operations platform 2026-02-08 22:54:37 -08:00
widgets feat: 生产级 API 错误处理 — 重试拦截器、友好错误提示、网络监测、WebSocket 退避 2026-02-23 04:01:04 -08:00