Setup the mute pin if configured (#3568)

This commit is contained in:
Jesse Hills 2022-06-17 13:30:21 +12:00
parent 8c9948bb56
commit aa0c2dedd9
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

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