Android: platform AEC doesn't cancel app's own playback unless the OUTPUT stream uses Usage::VoiceCommunication
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 74/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- android, cpp, react-native
- Ambito
- audio-video-rtc, mobile
Direzione di ricerca
Esamina openAudioStream() di AudioPlayer.cpp insieme alla gestione di voiceCommunication da parte di AudioRecorder. Verifica l’acquisizione e la riproduzione full-duplex su un dispositivo Android fisico con altoparlante, quindi implementa il comportamento concordato del flusso di output oppure documenta la configurazione necessaria nella prossima documentazione di AudioRecorder. Il lavoro è completato quando l’AEC della piattaforma rimuove l’eco del segnale locale senza modificare il routing dell’altoparlante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Feature Request
When building a full-duplex voice assistant (mic capture + TTS playback at the same
time), enabling androidInputPreset: 'voiceCommunication' on the AudioRecorder alone
was not enough to get working acoustic echo cancellation on Android. Our STT kept
transcribing the assistant's own TTS playback.
The missing piece: the output stream (AudioPlayer.cpp) is opened without any
Usage, which defaults to USAGE_MEDIA. On many devices, the platform AEC chain
engaged by the VOICE_COMMUNICATION input preset only references the
voice-communication output path and media-stream playback leaks into the microphone
uncancelled.
Adding two lines to the output stream builder fixed it completely:
// AudioPlayer.cpp — openAudioStream()
builder.setSharingMode(SharingMode::Exclusive)
->setFormat(AudioFormat::Float)
// ...existing config...
->setUsage(Usage::VoiceCommunication) // ← added
->setContentType(ContentType::Speech) // ← added
// ...
Environment
react-native-audio-api1.0.0-nightly-f8b57cd-20260825- React Native 0.86.2 / Expo SDK 57, physical Android device (loudspeaker, no headphones)
- Capture:
AudioRecorderwith{ androidInputPreset: 'voiceCommunication', iosVoiceProcessing: true } - Playback:
AudioContextplaying TTS PCM buffers - Use case: streaming STT (websocket ASR) while speaking TTS replies (barge-in style interaction)
Symptom before the patch
- Speech-to-text transcribed the assistant's own spoken replies as if they were user input
- Token-overlap heuristics and LLM-based intent filtering reduced but never eliminated
the self-echo turns - Verified the input preset reaches Oboe correctly (
setInputPreset(VoiceCommunication)
present inopenAudioStream()), so the gap was on the output/reference side
After the patch
- Self-echo eliminated at DSP level (zero phantom transcripts during playback)
- Real barge-in (user talking over the reply) works reliably
- No audio-routing regressions on our test device: playback still comes out of the
loudspeaker as before
Suggestions
- Library behavior: consider applying
Usage::VoiceCommunication(+ContentType::Speech)
to the output stream automatically when an active recorder uses
androidInputPreset: 'voiceCommunication'or expose an option for it. - Docs (
next→ AudioRecorder): the full-duplex section recommends
androidInputPreset: 'voiceCommunication'+iosVoiceProcessing: true, but doesn't
mention that the playback side must also sit on the voice-communication path for
Android AEC to reference it.
- Lingua principale
- C++
- Stelle
- 848
- Fork
- 95
- Merge medio
- 4g 20m
- PR unite (30g)
- 31
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di software-mansion/react-native-audio-api
-
android bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
software-mansion/react-native-audio-api#1273 · 5 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
software-mansion/react-native-audio-api#1238 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
software-mansion/react-native-audio-api#1340 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
software-mansion/react-native-audio-api#1339 ·
I maintainer di solito rispondono entro 2 giorni
-
Channel negotiation drops buffer swaps when several graph changes land in one render quantumForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
software-mansion/react-native-audio-api#1332 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di software-mansion/react-native-audio-api
Issue simili
-
agent:Windows bug code-review LOW testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
[Cleanup] Include the public header in work_split.cppForse già presa @blozano-tt l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
tenstorrent/tt-metal#60850 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
beehive-lab/TornadoVM#1248 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SimVascular/svZeroDSolver#253 ·
-
core: RAC_LLM_OPTIONS_DEFAULT.min_p disagrees with the IDL's annotated defaultForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug core p3
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
RunanywhereAI/runanywhere-sdks#1083 ·
I maintainer di solito rispondono entro 5 giorni