Start with speakers off.

This commit is contained in:
Fabian Schlenz 2019-11-30 13:37:35 +01:00
parent bcf7625285
commit 3751904cb4
3 changed files with 6 additions and 3 deletions

View File

@ -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);

View File

@ -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)) {

View File

@ -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;