esp-adf
esp-adf copied to clipboard
When I ran the routine play_tone_mp3_example , I found the problem.how to determine the prompt sound URI ? (AUD-3718)
Guys, who has used esp32 to burn the prompt sound, how to determine the prompt sound URI ?
const char* tone_uri[] =
{
"flash://tone/0_Bt_Reconnect.mp3",
"flash://tone/1_Wechat.mp3",
"flash://tone/2_Welcome_To_Wifi.mp3",
"flash://tone/3_New_Version_Available.mp3",
"flash://tone/4_Bt_Success.mp3",
"flash://tone/5_Freetalk.mp3",
"flash://tone/6_Upgrade_Done.mp3",
"flash://tone/7_shutdown.mp3",
"flash://tone/8_Alarm.mp3",
"flash://tone/9_Wifi_Success.mp3",
"flash://tone/10_Under_Smartconfig.mp3",
"flash://tone/11_Out_Of_Power.mp3",
"flash://tone/12_server_connect.mp3",
"flash://tone/13_hello.mp3",
"flash://tone/14_new_message.mp3",
"flash://tone/15_Please_Retry_Wifi.mp3",
"flash://tone/16_please_setting_wifi.mp3",
"flash://tone/17_Welcome_To_Bt.mp3",
"flash://tone/18_Wifi_Time_Out.mp3",
"flash://tone/19_Wifi_Reconnect.mp3",
"flash://tone/20_server_disconnect.mp3",
};
Hi @CAIJUN111
Please check the pipeline_flash_tone example. code belows:
ESP_LOGI(TAG, "[2.6] Set up uri (file as tone_stream, mp3 as mp3 decoder, and default output is i2s)");
audio_element_set_uri(tone_stream_reader, tone_uri[TONE_TYPE_HELLO]);
@HengYongChao Thanks for your reply. The essence of this function "audio_element_set_uri" is to bootstrap to the URI, For example, "flash://tone/0_Bt_Reconnect. Mp3 ", how can I confirm this URI from my synthesized .BIN file
Hi @CAIJUN111
The answer is in the readme of pipeline_flash_tone example.
Prerequisites
Required source file for the bin file address in flash has already been generated in the /tools/audio-esp.bin directory, and required source file for the audio file address in flash in the /components/audio_flash_tone/ directory.
If you need to generate your own audio-esp.bin, you need to first put mk_audio_bin.py (located in $ADF_PATH/tools/audio_tone/mk_audio_tone.py) and the user prompt tone file in the same directory. Then, run the mk_audio_bin.py script with the command below, which will eventually generate the audio-esp.bin file and the /audio_flash_tone/ folder in the upper directory of the script directory. The source file for the tone address in flash is stored in the /components/audio_flash_tone/ folder.
The Python script command is as follows:
python $ADF_PATH/tools/audio_tone/mk_audio_tone.py tone_mp3_folder
The default audio-esp.bin of this example contains the following audio files:
"flash://tone/0_Bt_Reconnect.mp3",
"flash://tone/1_Wechat.mp3",
"flash://tone/2_Welcome_To_Wifi.mp3",
"flash://tone/3_New_Version_Available.mp3",
"flash://tone/4_Bt_Success.mp3",
"flash://tone/5_Freetalk.mp3",
"flash://tone/6_Upgrade_Done.mp3",
"flash://tone/7_shutdown.mp3",
"flash://tone/8_Alarm.mp3",
"flash://tone/9_Wifi_Success.mp3",
"flash://tone/10_Under_Smartconfig.mp3",
"flash://tone/11_Out_Of_Power.mp3",
"flash://tone/12_server_connect.mp3",
"flash://tone/13_hello.mp3",
"flash://tone/14_new_message.mp3",
"flash://tone/15_Please_Retry_Wifi.mp3",
"flash://tone/16_please_setting_wifi.mp3",
"flash://tone/17_Welcome_To_Bt.mp3",
"flash://tone/18_Wifi_Time_Out.mp3",
"flash://tone/19_Wifi_Reconnect.mp3",
"flash://tone/20_server_disconnect.mp3",
You will get two files, audio_tone_uri.c, audio_tone_uri.h, please use them according to the documentation.
Yes,I have already generated my .bin file,but I don't know how to define my uri like "flash://tone/0_Bt_Reconnect.mp3".
------------------ 原始邮件 ------------------ 发件人: "espressif/esp-adf" @.>; 发送时间: 2022年3月25日(星期五) 下午4:27 @.>; @.@.>; 主题: Re: [espressif/esp-adf] When I ran the routine play_tone_mp3_example , I found the problem.how to determine the prompt sound URI ? (AUD-3718) (Issue #790)
Hi @CAIJUN111
The answer is in the readme of pipeline_flash_tone example.
Prerequisites
Required source file for the bin file address in flash has already been generated in the /tools/audio-esp.bin directory, and required source file for the audio file address in flash in the /components/audio_flash_tone/ directory.
If you need to generate your own audio-esp.bin, you need to first put mk_audio_bin.py (located in $ADF_PATH/tools/audio_tone/mk_audio_tone.py) and the user prompt tone file in the same directory. Then, run the mk_audio_bin.py script with the command below, which will eventually generate the audio-esp.bin file and the /audio_flash_tone/ folder in the upper directory of the script directory. The source file for the tone address in flash is stored in the /components/audio_flash_tone/ folder.
The Python script command is as follows:
python $ADF_PATH/tools/audio_tone/mk_audio_tone.py tone_mp3_folder
The default audio-esp.bin of this example contains the following audio files:
"flash://tone/0_Bt_Reconnect.mp3", "flash://tone/1_Wechat.mp3", "flash://tone/2_Welcome_To_Wifi.mp3", "flash://tone/3_New_Version_Available.mp3", "flash://tone/4_Bt_Success.mp3", "flash://tone/5_Freetalk.mp3", "flash://tone/6_Upgrade_Done.mp3", "flash://tone/7_shutdown.mp3", "flash://tone/8_Alarm.mp3", "flash://tone/9_Wifi_Success.mp3", "flash://tone/10_Under_Smartconfig.mp3", "flash://tone/11_Out_Of_Power.mp3", "flash://tone/12_server_connect.mp3", "flash://tone/13_hello.mp3", "flash://tone/14_new_message.mp3", "flash://tone/15_Please_Retry_Wifi.mp3", "flash://tone/16_please_setting_wifi.mp3", "flash://tone/17_Welcome_To_Bt.mp3", "flash://tone/18_Wifi_Time_Out.mp3", "flash://tone/19_Wifi_Reconnect.mp3", "flash://tone/20_server_disconnect.mp3",
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
Hi @CAIJUN111, did you resolved your problem?
This topic has become inactive so I'm going to close the issue. Please reopen this if you have any questions or need any further assistance.