2424static const char * TAG = "PLAY_HTTP_MUSIC" ;
2525
2626#define PIPELINE_BLOCK_BIT BIT(0)
27+ #define URI_HTTP "https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp3"
2728
2829
2930esp_err_t _pipeline_event (esp_gmf_event_pkt_t * event , void * ctx )
@@ -71,11 +72,11 @@ void app_main(void)
7172 esp_gmf_io_codec_dev_set_dev (ESP_GMF_PIPELINE_GET_OUT_INSTANCE (pipe ), esp_gmf_app_get_playback_handle ());
7273
7374 ESP_LOGI (TAG , "[ 4.1 ] Set audio url to play" );
74- esp_gmf_pipeline_set_in_uri (pipe , "https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp3" );
75+ esp_gmf_pipeline_set_in_uri (pipe , URI_HTTP );
7576 esp_gmf_element_handle_t dec_el = NULL ;
7677 esp_gmf_pipeline_get_el_by_name (pipe , "aud_dec" , & dec_el );
7778 esp_gmf_info_sound_t info = {0 };
78- esp_gmf_audio_helper_get_audio_type_by_uri ("https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp3" , & info .format_id );
79+ esp_gmf_audio_helper_get_audio_type_by_uri (URI_HTTP , & info .format_id );
7980 esp_gmf_audio_dec_reconfig_by_sound_info (dec_el , & info );
8081
8182 ESP_LOGI (TAG , "[ 5 ] Create gmf task, bind task to pipeline and load linked element jobs to the bind task" );
@@ -110,4 +111,4 @@ void app_main(void)
110111 esp_gmf_pool_deinit (pool );
111112 esp_gmf_app_wifi_disconnect ();
112113 esp_gmf_app_teardown_codec_dev ();
113- }
114+ }
0 commit comments