Audio
In the C202 SDK, what is the difference between audio_player_stop_and_wait, audio_player_stop_speak, and audio_player_raw_write_finish in the CI1302 audio flow?
audio_player_raw_write_finish: indicates the end of audio delivery, that is, the end of a data stream such as streaming TTS.audio_player_stop_speak: quickly responds to an asynchronous stop request, similar to pausing by key press.audio_player_stop_and_wait: forcibly stops playback and blocks until the stop is complete, for example when wake-up interrupts playback.
While using C202, the error ci13002_protocol: Deal recv frame too slow appears. What does it mean?
This error is triggered when xQueueSend cannot push the received frame data into the queue within the 10 ms timeout.
It means the uart_buffer_queue is full. Common causes include:
- The consumer is too slow. In
ci1302.c, theci1302_deal_task()task cannot dequeue and process data as fast as the UART receives it. - The queue depth is too small, so it fills up during bursts of incoming data.
- The consumer task is blocked by other operations such as file access or network requests and cannot dequeue data in time.
- The CI1302 sends a burst of data in a short time, such as audio streams or wake-up events, exceeding the current processing capacity.
How can AMR recording data be buffered in PSRAM first and then written to SPI flash when needed?
You can allocate a PSRAM buffer with heap_caps_malloc(size, MALLOC_CAP_SPIRAM) and write the AMR recording data into that buffer first.
After recording ends, or once the write condition is met, write the buffered data to SPIFFS/Flash either all at once or in chunks. This reduces frequent flash writes and improves the recording storage flow.
After changing the wake word on C302, how can the power-on prompt “I am Xiaoming” be disabled? Does the platform support custom wake words and acoustic-model upgrades?
To disable the power-on prompt, refer to chat_notify_list.c. This file contains multiple built-in local audio identifiers. Find the entry corresponding to “Ni Hao Xiao Ming”, then trace where the matching identifier header is invoked and disable that call.
The actual playback function is chat_notify_audio_play().
As for wake words and models, online acoustic-model upgrades are currently not supported:
- Only the model matching the current solution can be used, and the model itself cannot be upgraded over OTA.
- If the model must be upgraded, it can only be upgraded manually over UART.
- If you use UART-based upgrade, you also need to disable the
ota1302-related functionality in the SDK.