mirror of
https://github.com/esphome/esphome.git
synced 2026-05-23 03:06:05 +08:00
[audio] Disable FLAC CRC validation to improve decoding efficiency (#14108)
This commit is contained in:
@@ -85,6 +85,10 @@ esp_err_t AudioDecoder::start(AudioFileType audio_file_type) {
|
||||
#ifdef USE_AUDIO_FLAC_SUPPORT
|
||||
case AudioFileType::FLAC:
|
||||
this->flac_decoder_ = make_unique<esp_audio_libs::flac::FLACDecoder>();
|
||||
// CRC check slows down decoding by 15-20% on an ESP32-S3. FLAC sources in ESPHome are either from an http source
|
||||
// or built into the firmware, so the data integrity is already verified by the time it gets to the decoder,
|
||||
// making the CRC check unnecessary.
|
||||
this->flac_decoder_->set_crc_check_enabled(false);
|
||||
this->free_buffer_required_ =
|
||||
this->output_transfer_buffer_->capacity(); // Adjusted and reallocated after reading the header
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user