summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/host/audio_host/src/audio_app.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/host/audio_host/src/audio_app.c b/examples/host/audio_host/src/audio_app.c
index 0c4ed8a23..3102c28c9 100644
--- a/examples/host/audio_host/src/audio_app.c
+++ b/examples/host/audio_host/src/audio_app.c
@@ -287,6 +287,9 @@ void audio_app_task_read(void) {
if (frames == 0) {
return;
}
+ if (!spk_ready) {
+ return; // capture-only device or playback intentionally stopped
+ }
if (spk_config.channels == mic_config.channels) {
memcpy(spk_samples, mic_samples, frames * mic_config.channels * sizeof(int16_t));