diff --git a/src/main.cpp b/src/main.cpp index 55e2e22..cf458e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -70,6 +70,11 @@ void setup() { #endif INFO("Initializing...\n"); + PIN_SPEAKER_L_SETUP(); + PIN_SPEAKER_R_SETUP(); + PIN_SPEAKER_L(LOW); + PIN_SPEAKER_R(LOW); + DEBUG("Setting up SPI...\n"); SPI.begin(); SPI.setHwCs(false); diff --git a/src/player.cpp b/src/player.cpp index 5635fe8..e3b4740 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -10,8 +10,6 @@ Player::Player(SPIMaster* s) { _spi = s; PIN_VS1053_XRESET_SETUP(); PIN_VS1053_XRESET(HIGH); - PIN_SPEAKER_L_SETUP(); - PIN_SPEAKER_R_SETUP(); _speaker_off(); _spi->disable(); PIN_VS1053_DREQ_SETUP(); @@ -534,6 +532,7 @@ bool Player::play() { if (_state != idle) return false; if (_current_playlist == NULL) return false; if (_current_playlist->get_file_count()==0) return false; + _speaker_on(); _current_playlist->start(); String file; if (!_current_playlist->get_current_file(&file)) { diff --git a/src/playlist.cpp b/src/playlist.cpp index 6a14613..5f75e82 100644 --- a/src/playlist.cpp +++ b/src/playlist.cpp @@ -77,7 +77,6 @@ void Playlist::_examine_http_url(String url) { String ct = http->getContentType(); DEBUG("Content-Type is %s.\n", ct.c_str()); if (ct.startsWith("audio/x-mpegurl")) { - _parse_m3u(http); } else if (ct.startsWith("audio/")) { persistence = PERSIST_NONE;