Last Updated on : 2025-07-22 09:15:20download
The local audio play feature breaks through the limitations of network dependency, enabling more real-time audio play of prompts. This topic describes how to add local audio play capability to the T5AI-Board development board, ensuring a consistent user experience across diverse scenarios.
Use the Convertio tool to convert your WAV files to MP3 format.
Place the converted MP3 audio file, comeback.mp3
, in the media
folder.
Use the following script to convert the audio file into a C language file structure format:
$ python3 gen_media_src.py ../media/
Generated: ../media/../include/media_src_zh.h, ../media/../src/media_src_zh.c
Generated: ../media/../include/media_src_en.h, ../media/../src/media_src_en.c
Generated: ../media/../include/media_src.h
Add an enumeration.
For example, add an enumeration T5_ALART_TYPE_COMEBACK
for local prompt voice. And the voice content is “Hi, I’m back.”
Play the COMEBACK
local audio.
For example, when the T5 is woken up, it can play the prompt “Hi, I’m back” to notify users that the T5 has been woken up.
t5_ai_toy_alert(T5_ALART_TYPE_COMEBACK, TRUE);
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback