Hello,
I'm trying to replace the VC-02 audio with custom voice (112 WAV files converted to 16kHz mono MP3). I followed the method from post #6 (AI-Thinker Xiaoze):
What I did:
Converted 112 custom WAV files to 16kHz mono MP3 (using ffmpeg)
Replaced all MP3 files in /tools/scripts/tones/ folder (126 total MP3s)
Fixed Python 2→3 compatibility issues in res_build_tool.py and auto_code.py
Ran python res_build_tool.py manual
Built firmware using v3s NDS32 toolchain
Results:
✅ pcm.bin is generated successfully (340KB - correct size for custom audio)
✅ pcm_bin.h is generated (2.1MB)
✅ Firmware compiles without errors
❌ Final uni_app.bin is only 1.5MB (should be ~1.6MB like original)
❌ VC-02 flashes successfully but has no audio output (completely silent)
Analysis:
uni_pcm_player.c includes pcm_bin.h correctly (line 28)
pcm_bin[] array is referenced in code (line 74)
uni_pcm_player.o is compiled successfully
But pcm_bin symbol is NOT in final binary (checked with nm)
Firmware is ~60KB smaller than original (missing audio data)
Suspected cause:
Linker flag --gc-sections in makefile might be removing pcm_bin[] as "unused" even though it's referenced in code.
Question:
How can I ensure pcm_bin[] data is included in the final firmware? Is there a linker script modification or compiler flag needed?
Environment:
The playable audio files should not only be in 16kHz mono format but also have a depth of 16 bits. It is recommended to use Format Factory for conversion. Additionally, you can replace the corresponding MP3 files in the directory: replace/uni_hb_m_solution/unione_lite_app_hb_m/tools/scripts/tones. Other unused files do not need to be replaced.
Aithinker-weij 发表于 2026-1-12 17:11
The playable audio files should not only be in 16kHz mono format but also have a depth of 16 bits. I ...
Thank you for the reply. I already used 16kHz mono 16-bit MP3 files in the tones/ folder, but my problem is different:
After compiling, the pcm_bin[] symbol is NOT included in the final uni_app.bin. The firmware is 60KB smaller than original and has no audio output.
I suspect the linker flag --gc-sections removes pcm_bin as "unused".
How can I force the linker to keep pcm_bin[] in the binary?
Replace the MP3 files in the "uni_hb_m_solution/unione_lite_app_hb_m/tools/scripts/tones" folder, and then use "user_player_reply_list_random" to play the corresponding MP3 files.