Setup the mute pin if configured (#3568)

This commit is contained in:
Jesse Hills 2022-06-17 13:30:21 +12:00 committed by GitHub
parent 06440d0202
commit 01bfafc5f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,10 @@ void I2SAudioMediaPlayer::setup() {
this->audio_ = make_unique<Audio>(false);
this->audio_->setPinout(this->bclk_pin_, this->lrclk_pin_, this->dout_pin_);
this->audio_->forceMono(this->external_dac_channels_ == 1);
if (this->mute_pin_ != nullptr) {
this->mute_pin_->setup();
this->mute_pin_->digital_write(false);
}
}
this->state = media_player::MEDIA_PLAYER_STATE_IDLE;
}