bolar_2 backup
This commit is contained in:
483
main/audio/capture_pipeline.cc
Normal file
483
main/audio/capture_pipeline.cc
Normal file
@@ -0,0 +1,483 @@
|
||||
#include "audio/capture_pipeline.h"
|
||||
|
||||
#include "diagnostics/audio_tap.h"
|
||||
|
||||
#include <esp_heap_caps.h>
|
||||
#include <esp_log.h>
|
||||
#include <esp_timer.h>
|
||||
#include <freertos/idf_additions.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <cstdint>
|
||||
|
||||
namespace borla {
|
||||
namespace {
|
||||
|
||||
constexpr const char* kTag = "CapturePipeline2";
|
||||
constexpr uint32_t kOpusBitrate = 24000;
|
||||
|
||||
} // namespace
|
||||
|
||||
CapturePipeline::CapturePipeline(IAudioInput& input)
|
||||
: input_(input)
|
||||
{
|
||||
}
|
||||
|
||||
CapturePipeline::~CapturePipeline()
|
||||
{
|
||||
Stop();
|
||||
heap_caps_free(hardware_pcm_);
|
||||
heap_caps_free(raw_protocol_pcm_);
|
||||
heap_caps_free(processed_protocol_pcm_);
|
||||
heap_caps_free(encoded_);
|
||||
}
|
||||
|
||||
bool CapturePipeline::Initialize()
|
||||
{
|
||||
if (initialized_) {
|
||||
return true;
|
||||
}
|
||||
if (input_.InputSampleRate() != kHardwareSampleRate
|
||||
|| !encoder_.Initialize(kProtocolSampleRate, 1, kOpusBitrate)) {
|
||||
ESP_LOGE(kTag, "input rate/encoder initialization failed");
|
||||
return false;
|
||||
}
|
||||
// Internal RAM: these four are touched several times per frame by the
|
||||
// resampler, the AEC and the encoder, and together they are only ~7 KB.
|
||||
// The bulk storage that genuinely belongs in PSRAM is encode_slots_ below,
|
||||
// which is written and read once per frame as a straight memcpy.
|
||||
hardware_pcm_ = static_cast<int16_t*>(
|
||||
//heap_caps_calloc(Pcm24kTo16kConverter::kInputSamples, sizeof(int16_t),
|
||||
heap_caps_calloc(Pcm48kTo16kConverter::kInputSamples, sizeof(int16_t),
|
||||
MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));//2026-9-3 ckkj debug :wifi start fail
|
||||
//MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT));
|
||||
raw_protocol_pcm_ = static_cast<int16_t*>(
|
||||
//heap_caps_calloc(Pcm24kTo16kConverter::kOutputSamples, sizeof(int16_t),
|
||||
//MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT));
|
||||
heap_caps_calloc(Pcm48kTo16kConverter::kOutputSamples, sizeof(int16_t),
|
||||
MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));//2026-9-3 ckkj debug :wifi start fail
|
||||
|
||||
processed_protocol_pcm_ = static_cast<int16_t*>(
|
||||
//heap_caps_calloc(Pcm24kTo16kConverter::kOutputSamples, sizeof(int16_t),
|
||||
heap_caps_calloc(Pcm48kTo16kConverter::kOutputSamples, sizeof(int16_t),
|
||||
MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
|
||||
encoded_ = static_cast<uint8_t*>(
|
||||
heap_caps_calloc(kBinaryAudioMaximumUplinkOpusBytes, sizeof(uint8_t),
|
||||
MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
|
||||
encode_slots_ = static_cast<int16_t*>(
|
||||
//heap_caps_calloc(kEncodeSlots * Pcm24kTo16kConverter::kOutputSamples,
|
||||
heap_caps_calloc(kEncodeSlots * Pcm48kTo16kConverter::kOutputSamples,
|
||||
sizeof(int16_t), MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
|
||||
stopped_signal_ = xSemaphoreCreateBinaryStatic(&stopped_signal_storage_);
|
||||
encoder_stopped_signal_ =
|
||||
xSemaphoreCreateBinaryStatic(&encoder_stopped_signal_storage_);
|
||||
encode_ready_ = xQueueCreate(kEncodeSlots, sizeof(uint8_t));
|
||||
encode_free_ = xQueueCreate(kEncodeSlots, sizeof(uint8_t));
|
||||
if (hardware_pcm_ == nullptr || raw_protocol_pcm_ == nullptr
|
||||
|| processed_protocol_pcm_ == nullptr
|
||||
|| encoded_ == nullptr || stopped_signal_ == nullptr
|
||||
|| encode_slots_ == nullptr || encode_ready_ == nullptr
|
||||
|| encode_free_ == nullptr || encoder_stopped_signal_ == nullptr) {
|
||||
ESP_LOGE(kTag, "capture buffers/signal allocation failed");
|
||||
return false;
|
||||
}
|
||||
initialized_ = true;
|
||||
ESP_LOGI(kTag,
|
||||
"initialized hardware=48k protocol=16k frame=60ms bitrate=%lu",
|
||||
static_cast<unsigned long>(kOpusBitrate));
|
||||
return true;
|
||||
}
|
||||
|
||||
// bool CapturePipeline::Start()
|
||||
// {
|
||||
// if (running_.load()) {
|
||||
// return true;
|
||||
// }
|
||||
// if (!initialized_ && !Initialize()) {
|
||||
// return false;
|
||||
// }
|
||||
// xSemaphoreTake(stopped_signal_, 0);
|
||||
// xSemaphoreTake(encoder_stopped_signal_, 0);
|
||||
// xQueueReset(encode_ready_);
|
||||
// xQueueReset(encode_free_);
|
||||
// for (uint8_t slot = 0; slot < kEncodeSlots; ++slot) {
|
||||
// xQueueSend(encode_free_, &slot, 0);
|
||||
// }
|
||||
// running_.store(true);
|
||||
// // Plain xTaskCreate: the stack comes from the internal heap and goes back
|
||||
// // to it on Stop(), which is what BLE provisioning relies on when it
|
||||
// // releases the audio engine to make room for the WiFi driver.
|
||||
// const BaseType_t result
|
||||
// = xTaskCreatePinnedToCore(&CapturePipeline::TaskEntry,
|
||||
// "capture2", task_stack_budget::kCaptureBytes, this,
|
||||
// task_priority::kCaptureLoop, &task_, 0);
|
||||
// if (result != pdPASS) {
|
||||
// running_.store(false);
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
bool CapturePipeline::Start()
|
||||
{
|
||||
if (running_.load()) {
|
||||
return true;
|
||||
}
|
||||
if (!initialized_ && !Initialize()) {
|
||||
return false;
|
||||
}
|
||||
xSemaphoreTake(stopped_signal_, 0);
|
||||
xSemaphoreTake(encoder_stopped_signal_, 0);
|
||||
xQueueReset(encode_ready_);
|
||||
xQueueReset(encode_free_);
|
||||
for (uint8_t slot = 0; slot < kEncodeSlots; ++slot) {
|
||||
xQueueSend(encode_free_, &slot, 0);
|
||||
}
|
||||
running_.store(true);
|
||||
// Plain xTaskCreate: the stack comes from the internal heap and goes back
|
||||
// to it on Stop(), which is what BLE provisioning relies on when it
|
||||
// releases the audio engine to make room for the WiFi driver.
|
||||
const BaseType_t result
|
||||
= xTaskCreatePinnedToCore(&CapturePipeline::TaskEntry,
|
||||
"capture2", task_stack_budget::kCaptureBytes,
|
||||
this,
|
||||
task_priority::kCaptureLoop, &task_, 0);
|
||||
if (result != pdPASS) {
|
||||
running_.store(false);
|
||||
task_ = nullptr;
|
||||
ESP_LOGE(kTag, "capture task creation failed");
|
||||
return false;
|
||||
}
|
||||
// Core 1: capture is pinned to core 0, so this is real parallelism.
|
||||
const BaseType_t encoder_result
|
||||
= xTaskCreatePinnedToCoreWithCaps(&CapturePipeline::EncoderTaskEntry,
|
||||
"capture_enc2", task_stack_budget::kCaptureEncoderBytes, this,
|
||||
task_priority::kAudioCodec, &encoder_task_, 1,
|
||||
MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||
if (encoder_result != pdPASS) {
|
||||
running_.store(false);
|
||||
encoder_task_ = nullptr;
|
||||
// The capture task above was already created; without this it would
|
||||
// park itself in vTaskSuspend forever and strand its internal-RAM
|
||||
// stack — on the pool this whole exercise is trying to protect.
|
||||
if (xSemaphoreTake(stopped_signal_, pdMS_TO_TICKS(1500)) != pdTRUE) {
|
||||
ESP_LOGE(kTag, "capture task stop timed out");
|
||||
}
|
||||
vTaskDelete(task_);
|
||||
task_ = nullptr;
|
||||
ESP_LOGE(kTag, "capture encoder task creation failed");
|
||||
return false;
|
||||
}
|
||||
ESP_LOGI(kTag, "task started stack_bytes=%u memory=internal prio=%u",
|
||||
static_cast<unsigned>(task_stack_budget::kCaptureBytes),
|
||||
static_cast<unsigned>(task_priority::kCaptureLoop));
|
||||
return true;
|
||||
}
|
||||
|
||||
void CapturePipeline::Stop()
|
||||
{
|
||||
if (!running_.exchange(false)) {
|
||||
return;
|
||||
}
|
||||
policy_.store(AudioPolicy::kOff);
|
||||
if (task_ != nullptr) {
|
||||
if (xSemaphoreTake(stopped_signal_, pdMS_TO_TICKS(1500)) != pdTRUE) {
|
||||
ESP_LOGE(kTag, "capture task stop timed out");
|
||||
}
|
||||
vTaskDelete(task_);
|
||||
task_ = nullptr;
|
||||
}
|
||||
if (encoder_task_ != nullptr) {
|
||||
if (xSemaphoreTake(
|
||||
encoder_stopped_signal_, pdMS_TO_TICKS(1500)) != pdTRUE) {
|
||||
ESP_LOGE(kTag, "capture encoder task stop timed out");
|
||||
}
|
||||
vTaskDeleteWithCaps(encoder_task_);
|
||||
encoder_task_ = nullptr;
|
||||
}
|
||||
IEncodedAudioSink* sink = sink_.load();
|
||||
if (sink != nullptr) {
|
||||
sink->FlushEncodedAudio();
|
||||
}
|
||||
}
|
||||
|
||||
void CapturePipeline::SetSink(IEncodedAudioSink* sink) { sink_.store(sink); }
|
||||
|
||||
void CapturePipeline::SetAudioTap(AudioTap* tap)
|
||||
{
|
||||
audio_tap_.store(tap, std::memory_order_release);
|
||||
}
|
||||
|
||||
void CapturePipeline::SetProcessor(IVoiceFrameProcessor* processor)
|
||||
{
|
||||
processor_.store(processor);
|
||||
}
|
||||
|
||||
void CapturePipeline::ApplyPolicy(AudioPolicy policy)
|
||||
{
|
||||
const AudioPolicy previous = policy_.exchange(policy);
|
||||
IVoiceFrameProcessor* processor = processor_.load();
|
||||
if (processor != nullptr) {
|
||||
processor->ApplyPolicy(policy);
|
||||
}
|
||||
if (CaptureEnabled(previous) && !CaptureEnabled(policy)) {
|
||||
// The encoder state must be reset by the encoder task itself, not
|
||||
// here: this runs on the application task while RunEncoder may be in
|
||||
// the middle of encoder_.Encode() on core 1, and libopus state is not
|
||||
// reentrant — a concurrent Reset() tears the state mid-frame. Every
|
||||
// conversation turn ends by leaving a capture policy, so the race was
|
||||
// armed constantly.
|
||||
encoder_reset_pending_.store(true);
|
||||
IEncodedAudioSink* sink = sink_.load();
|
||||
if (sink != nullptr) {
|
||||
sink->FlushEncodedAudio();
|
||||
}
|
||||
}
|
||||
// Debug: the engine's one-line summary already reports every change.
|
||||
ESP_LOGD(kTag, "policy=%s capture=%d", ToString(policy),
|
||||
CaptureEnabled(policy) ? 1 : 0);
|
||||
}
|
||||
|
||||
CaptureMetrics CapturePipeline::Metrics() const
|
||||
{
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
const CaptureMetrics snapshot = metrics_;
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
void CapturePipeline::TaskEntry(void* context)
|
||||
{
|
||||
static_cast<CapturePipeline*>(context)->Run();
|
||||
}
|
||||
|
||||
[[noreturn]] void CapturePipeline::Run()
|
||||
{
|
||||
ESP_LOGI(kTag, "capture owner task started");
|
||||
while (running_.load()) {
|
||||
const AudioPolicy policy = policy_.load();
|
||||
if (!InputEnabled(policy)) {
|
||||
vTaskDelay(pdMS_TO_TICKS(20));
|
||||
continue;
|
||||
}
|
||||
|
||||
const uint64_t read_start_us =
|
||||
static_cast<uint64_t>(esp_timer_get_time());
|
||||
if (!input_.Read(
|
||||
//hardware_pcm_, Pcm24kTo16kConverter::kInputSamples, 100)) {
|
||||
hardware_pcm_, Pcm48kTo16kConverter::kInputSamples, 100)) {
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
metrics_.read_failures++;
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
continue;
|
||||
}
|
||||
const uint64_t convert_start_us =
|
||||
static_cast<uint64_t>(esp_timer_get_time());
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
metrics_.frames_read++;
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
|
||||
if (!converter_.Convert(hardware_pcm_,
|
||||
// Pcm24kTo16kConverter::kInputSamples, raw_protocol_pcm_,
|
||||
// Pcm24kTo16kConverter::kOutputSamples)) {
|
||||
Pcm48kTo16kConverter::kInputSamples, raw_protocol_pcm_,
|
||||
Pcm48kTo16kConverter::kOutputSamples)) {
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
metrics_.encode_failures++;
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
continue;
|
||||
}
|
||||
|
||||
const uint64_t process_start_us =
|
||||
static_cast<uint64_t>(esp_timer_get_time());
|
||||
IVoiceFrameProcessor* processor = processor_.load();
|
||||
const bool frame_passed = processor == nullptr
|
||||
|| processor->Process(policy, raw_protocol_pcm_,
|
||||
//Pcm24kTo16kConverter::kOutputSamples,
|
||||
Pcm48kTo16kConverter::kOutputSamples,
|
||||
processed_protocol_pcm_,
|
||||
//Pcm24kTo16kConverter::kOutputSamples);
|
||||
Pcm48kTo16kConverter::kOutputSamples);
|
||||
const int16_t* upload_pcm = processor != nullptr
|
||||
? processed_protocol_pcm_
|
||||
: raw_protocol_pcm_;
|
||||
// Server's-ear channel: exactly the PCM that goes to the encoder, or
|
||||
// silence when this frame is suppressed/not uplinked — so listening
|
||||
// to uplink.wav answers "what did the server hear at second N".
|
||||
if (AudioTap* tap =
|
||||
audio_tap_.load(std::memory_order_acquire)) {
|
||||
const bool uplinked = frame_passed && CaptureEnabled(policy);
|
||||
tap->PushUplink(uplinked ? upload_pcm : nullptr,
|
||||
//Pcm24kTo16kConverter::kOutputSamples);
|
||||
Pcm48kTo16kConverter::kOutputSamples);
|
||||
}
|
||||
if (!frame_passed) {
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
metrics_.encode_failures++;
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
continue;
|
||||
}
|
||||
if (!CaptureEnabled(policy)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const uint64_t handoff_start_us =
|
||||
static_cast<uint64_t>(esp_timer_get_time());
|
||||
|
||||
// Hand the frame to the encoder task instead of encoding here. A full
|
||||
// free queue means the encoder is behind; dropping the newest frame is
|
||||
// better than stalling capture, because a stalled capture loses the
|
||||
// microphone stream itself and with it the AEC alignment.
|
||||
uint8_t slot = 0;
|
||||
if (xQueueReceive(encode_free_, &slot, 0) != pdTRUE) {
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
metrics_.backpressure_drops++;
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
continue;
|
||||
}
|
||||
std::memcpy(
|
||||
//encode_slots_ + slot * Pcm24kTo16kConverter::kOutputSamples,
|
||||
encode_slots_ + slot * Pcm48kTo16kConverter::kOutputSamples,
|
||||
upload_pcm,
|
||||
//Pcm24kTo16kConverter::kOutputSamples * sizeof(int16_t));
|
||||
Pcm48kTo16kConverter::kOutputSamples * sizeof(int16_t));
|
||||
if (xQueueSend(encode_ready_, &slot, 0) != pdTRUE) {
|
||||
xQueueSend(encode_free_, &slot, 0);
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
metrics_.backpressure_drops++;
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
continue;
|
||||
}
|
||||
|
||||
const uint64_t handoff_end_us =
|
||||
static_cast<uint64_t>(esp_timer_get_time());
|
||||
RecordTimings(
|
||||
static_cast<uint32_t>(convert_start_us - read_start_us),
|
||||
static_cast<uint32_t>(process_start_us - convert_start_us),
|
||||
static_cast<uint32_t>(handoff_start_us - process_start_us),
|
||||
0,
|
||||
static_cast<uint32_t>(handoff_end_us - handoff_start_us));
|
||||
}
|
||||
xSemaphoreGive(stopped_signal_);
|
||||
for (;;) {
|
||||
vTaskSuspend(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void CapturePipeline::EncoderTaskEntry(void* context)
|
||||
{
|
||||
static_cast<CapturePipeline*>(context)->RunEncoder();
|
||||
}
|
||||
|
||||
[[noreturn]] void CapturePipeline::RunEncoder()
|
||||
{
|
||||
ESP_LOGI(kTag, "capture encoder task started stack_bytes=%u memory=PSRAM",
|
||||
static_cast<unsigned>(task_stack_budget::kCaptureEncoderBytes));
|
||||
while (running_.load()) {
|
||||
if (encoder_reset_pending_.exchange(false)) {
|
||||
encoder_.Reset();
|
||||
}
|
||||
uint8_t slot = 0;
|
||||
if (xQueueReceive(encode_ready_, &slot, pdMS_TO_TICKS(100))
|
||||
!= pdTRUE) {
|
||||
continue;
|
||||
}
|
||||
const int16_t* pcm =
|
||||
//encode_slots_ + slot * Pcm48kTo16kConverter::kOutputSamples;
|
||||
encode_slots_ + slot * Pcm48kTo16kConverter::kOutputSamples;
|
||||
const uint64_t encode_start_us =
|
||||
static_cast<uint64_t>(esp_timer_get_time());
|
||||
size_t encoded_size = 0;
|
||||
const bool encoded = encoder_.Encode(pcm,
|
||||
//Pcm24kTo16kConverter::kOutputSamples, encoded_,
|
||||
Pcm48kTo16kConverter::kOutputSamples, encoded_,
|
||||
kBinaryAudioMaximumUplinkOpusBytes, &encoded_size);
|
||||
const uint64_t encode_end_us =
|
||||
static_cast<uint64_t>(esp_timer_get_time());
|
||||
|
||||
bool sent = false;
|
||||
if (encoded) {
|
||||
IEncodedAudioSink* sink = sink_.load();
|
||||
sent = sink != nullptr
|
||||
&& sink->SubmitEncodedAudio(encoded_, encoded_size);
|
||||
}
|
||||
const uint64_t submit_end_us =
|
||||
static_cast<uint64_t>(esp_timer_get_time());
|
||||
|
||||
xQueueSend(encode_free_, &slot, 0);
|
||||
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
if (!encoded) {
|
||||
metrics_.encode_failures++;
|
||||
} else {
|
||||
metrics_.frames_encoded++;
|
||||
metrics_.maximum_encoded_bytes
|
||||
= std::max(metrics_.maximum_encoded_bytes,
|
||||
static_cast<uint32_t>(encoded_size));
|
||||
if (sent) {
|
||||
metrics_.frames_sent++;
|
||||
} else {
|
||||
metrics_.backpressure_drops++;
|
||||
}
|
||||
}
|
||||
timings_.encode_us += encode_end_us - encode_start_us;
|
||||
timings_.encode_us_max = std::max(timings_.encode_us_max,
|
||||
static_cast<uint32_t>(encode_end_us - encode_start_us));
|
||||
timings_.submit_us += submit_end_us - encode_end_us;
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
// One tick between frames so IDLE1 gets runtime while the slot queue
|
||||
// is backlogged. A single opus_encode() call cannot yield internally,
|
||||
// and when frames queue up the xQueueReceive above returns instantly,
|
||||
// so without this the loop monopolises core 1 for as long as the
|
||||
// backlog lasts and the task watchdog fires — every backtrace it
|
||||
// printed ended inside silk_encode. Costs 1 ms per 60 ms frame.
|
||||
vTaskDelay(1);
|
||||
}
|
||||
xSemaphoreGive(encoder_stopped_signal_);
|
||||
for (;;) {
|
||||
vTaskSuspend(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void CapturePipeline::RecordTimings(uint32_t read_us, uint32_t convert_us,
|
||||
uint32_t process_us, uint32_t encode_us, uint32_t submit_us)
|
||||
{
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
timings_.frames++;
|
||||
timings_.read_us += read_us;
|
||||
timings_.convert_us += convert_us;
|
||||
timings_.process_us += process_us;
|
||||
timings_.encode_us += encode_us;
|
||||
timings_.submit_us += submit_us;
|
||||
timings_.read_us_max = std::max(timings_.read_us_max, read_us);
|
||||
timings_.process_us_max = std::max(timings_.process_us_max, process_us);
|
||||
timings_.encode_us_max = std::max(timings_.encode_us_max, encode_us);
|
||||
timings_.submit_us_max = std::max(timings_.submit_us_max, submit_us);
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
}
|
||||
|
||||
CaptureTimings CapturePipeline::ConsumeTimings()
|
||||
{
|
||||
portENTER_CRITICAL(&metrics_lock_);
|
||||
const CaptureTimings snapshot = timings_;
|
||||
timings_ = CaptureTimings{};
|
||||
portEXIT_CRITICAL(&metrics_lock_);
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
bool CapturePipeline::CaptureEnabled(AudioPolicy policy) const
|
||||
{
|
||||
return policy == AudioPolicy::kConversationCapture
|
||||
|| policy == AudioPolicy::kBargeInDuplex
|
||||
|| policy == AudioPolicy::kCallDuplex;
|
||||
}
|
||||
|
||||
bool CapturePipeline::InputEnabled(AudioPolicy policy) const
|
||||
{
|
||||
return policy == AudioPolicy::kWakeWordOnly ||
|
||||
policy == AudioPolicy::kWakeWordDuplex ||
|
||||
CaptureEnabled(policy);
|
||||
}
|
||||
|
||||
} // namespace borla
|
||||
Reference in New Issue
Block a user