Additional Switching Station URLs Problems #1782
-
I am having trouble switching between the following 4 URL internet radio streams. Using a Audio.h version I am able to connect to host and listen to stations per index. Using AudioTools with the player to switch the stations by index is not working well. Stations 0 to 1 switch fine and play back. Moving on from station 1 [Scenic Route] to station 2 [Nashville], playback fails and then after a pause the player will actually connect to station 3 [Irish Folk]. Moving on to station 3 from 2, will connect correctly to Irish Folk but has gaps in playback sound. If I move backwards to station 2 [the German Nashville sound station], now connects. Playback has noticeable sound gaps. The problem appears to be something in the station streams or handling of addresses. Other urls such as station 0 [Folk Alley] and station 1 [Scenic Route] play well and switch well. I am attaching the Serial logs of metadata callback for the audio and player versions for comparison. The version using audio.h with audio info output has more info details about the streams but I am unable to pick out the problem. They all seem to have 44100 bits per second, 2 channel, and metaint 16000 data. Hope somebody has some suggestions.
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I have no clue what you talk about: what is audio.h ? Also try to avoid https if plain vanilla http is working: https adds a lot of overhead! |
Beta Was this translation helpful? Give feedback.
-
Audio.h is a common ESP32 library from Espressif. Most of the Arduino IDE examples for I2S use it and I assumed you were very familar with it. In my case the stations urls are listed in a file on my SD Card. That list is then read into a string array in the program and the index position used to connect to the host stations. Below is the audio version. The player version did not use the SD card and puts the url list in a char * array instead of a string array. `//********************************************************************************************************** #include <Arduino.h> void open_new_song(String filename); void check_serial_radio(); WiFiMulti wifiMulti; SSD1306Wire display(0x3c, 16, 17); // ADDRESS, SDA, SCL //SD MMC Lines // Some Pins for buttong Toggles const int Pin_vol_up = 47; // cycles volume in steps of 4 from 1 to 20 const int Pin_down = 1; // i2s audio pins Audio audio; struct Music_info String song_list[100]; String wifi = "wifi"; int dstation=0; bool bstop=0; }; void get_netname_password(){ void setup() {
} uint run_time = 0;
*/
//update to selected station and volume values if they were changed in the checks operations } } //////////////////////////////////////////////////////////////
} void change_station(){ void check_serial_radio(){
} void check_vol_change(){
} void check_station_change(){ void check_MP3_play() {
} void open_new_song(String filename){ void display_music(){ } void logoshow(void){ void lcd_text(String text){ void display_StationVolume(){ void print_song_info(){ void print_song_time(){ // optional } void audio_id3data(const char *info){ //id3 metadata void audio_eof_mp3(const char *info){ //end of file void audio_showstation(const char *info){ } void audio_showstreamtitle(const char *info){ void audio_bitrate(const char *info){ void audio_commercial(const char *info){ //duration in sec void audio_icyurl(const char *info){ //homepage void audio_lasthost(const char *info){ //stream URL played int get_music_list(fs::FS &fs, const char *dirname, uint8_t levels, String wavlist[100]) { int get_station_list(fs::FS &fs, const char *dirname, uint8_t levels, String stations[100]) { |
Beta Was this translation helpful? Give feedback.
-
FYI - The reason for preferring https instead of http: is that I do development on a Windows 11 system and the default Windows security system kept giving my dangerous warning popups or refused connections in my browsers. It is not a problem on my raspberry pi systems and agree with yoiur comment. The overhead did not seem to be problem though as the audio version plays those streams fine and your player version plays most of my streams well. I can send you the full 58 stream list that I am currently using if you want but was trying to keep messages short. |
Beta Was this translation helpful? Give feedback.
-
A better reference for ESP32-audioI2S is the following. I think this might have been the source for code examples that I built from but I had it from a complex twisted path so not sure. #include "Audio.h" //see Schhreibfaul1 repository at github "https://github.com/schreibfaul1/ESP32-audioI2S" The simple radio example at his site might be good to use for comparing station playback. Audio.h seems to detect different types of audio streams and automatically switches the codec as needed so that might be the difference. I think audiotool player actually sounds a little better on some streams but has trouble playing others. Still working understanding the differences. |
Beta Was this translation helpful? Give feedback.
I have no clue what you talk about: what is audio.h ?
What logic are you using to select a channel ?
I think you need to make some more test cases to nail down the problem...
Also try to avoid https if plain vanilla http is working: https adds a lot of overhead!