[audio] Add support for sinking via an arbitrary callback (#14035)

This commit is contained in:
Kevin Ahrendt
2026-02-18 21:50:39 -06:00
committed by GitHub
parent c8598fe620
commit 3c227eeca4
2 changed files with 13 additions and 0 deletions
@@ -165,6 +165,8 @@ size_t AudioSinkTransferBuffer::transfer_data_to_sink(TickType_t ticks_to_wait,
if (this->ring_buffer_.use_count() > 0) {
bytes_written =
this->ring_buffer_->write_without_replacement((void *) this->data_start_, this->available(), ticks_to_wait);
} else if (this->sink_callback_ != nullptr) {
bytes_written = this->sink_callback_->audio_sink_write(this->data_start_, this->available(), ticks_to_wait);
}
this->decrease_buffer_length(bytes_written);