Skip to content

Commit

Permalink
Merge branch 'av_stream/add_resample_support' into 'master'
Browse files Browse the repository at this point in the history
av_stream: support audio resample

See merge request adf/esp-adf-internal!1164
  • Loading branch information
jason-mao committed Feb 23, 2023
2 parents 730d007 + 25cc074 commit 302f9a2
Show file tree
Hide file tree
Showing 10 changed files with 304 additions and 200 deletions.
90 changes: 38 additions & 52 deletions examples/protocols/components/audio_flash_tone/audio_tone_uri.c
Original file line number Diff line number Diff line change
@@ -1,52 +1,38 @@
/*
* ESPRESSIF MIT License
*
* Copyright (c) 2021 <ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD>
*
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in which case,
* it is free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/

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",
};

int get_tone_uri_num()
{
return sizeof(tone_uri) / sizeof(char *) - 1;
}
/*
* ESPRESSIF MIT License
*
* Copyright (c) 2023 <ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD>
*
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in which case,
* it is free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/

const char* tone_uri[] = {
"flash://tone/0_Alarm.mp3",
"flash://tone/1_Under_Smartconfig.mp3",
"flash://tone/2_Wifi_Reconnect.mp3",
"flash://tone/3_Wifi_Success.mp3",
"flash://tone/4_please_setting_wifi.mp3",
"flash://tone/5_server_connect.mp3",
"flash://tone/6_server_disconnect.mp3",
};

int get_tone_uri_num()
{
return sizeof(tone_uri) / sizeof(char *) - 1;
}
22 changes: 4 additions & 18 deletions examples/protocols/components/audio_flash_tone/audio_tone_uri.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* ESPRESSIF MIT License
*
* Copyright (c) 2021 <ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD>
* Copyright (c) 2023 <ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD>
*
* Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in which case,
* it is free of charge, to any person obtaining a copy of this software and associated
Expand Down Expand Up @@ -32,26 +32,12 @@ extern "C" {
extern const char* tone_uri[];

typedef enum {
TONE_TYPE_BT_RECONNECT,
TONE_TYPE_WECHAT,
TONE_TYPE_WELCOME_TO_WIFI,
TONE_TYPE_NEW_VERSION_AVAILABLE,
TONE_TYPE_BT_SUCCESS,
TONE_TYPE_FREETALK,
TONE_TYPE_UPGRADE_DONE,
TONE_TYPE_SHUTDOWN,
TONE_TYPE_ALARM,
TONE_TYPE_WIFI_SUCCESS,
TONE_TYPE_UNDER_SMARTCONFIG,
TONE_TYPE_OUT_OF_POWER,
TONE_TYPE_SERVER_CONNECT,
TONE_TYPE_HELLO,
TONE_TYPE_NEW_MESSAGE,
TONE_TYPE_PLEASE_RETRY_WIFI,
TONE_TYPE_PLEASE_SETTING_WIFI,
TONE_TYPE_WELCOME_TO_BT,
TONE_TYPE_WIFI_TIME_OUT,
TONE_TYPE_WIFI_RECONNECT,
TONE_TYPE_WIFI_SUCCESS,
TONE_TYPE_PLEASE_SETTING_WIFI,
TONE_TYPE_SERVER_CONNECT,
TONE_TYPE_SERVER_DISCONNECT,
TONE_TYPE_MAX,
} tone_type_t;
Expand Down
Binary file not shown.
Loading

0 comments on commit 302f9a2

Please sign in to comment.