MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ record()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = Eigen::MatrixXd>
size_t MayaFlux::Yantra::VadAnalyzer< InputType, OutputType >::record ( std::span< const float > samples)
inlinenodiscard

Run every chunk the samples complete without waiting for the result.

The probabilities stay on the device, in probability_buffer, and are recorded into the analyzer's recording without a submission. A consumer on the same recording, such as an IntervalExtractor, reads them in place and submits. Whole chunks only: a partial chunk stays pending, and flush_tail does not apply. At most 4096 chunks run per call, so read the buffer before the next call.

Parameters
samplesMono samples at 16 kHz, continuing the stream.
Returns
The number of chunks recorded.
Exceptions
std::invalid_argumentwhen the config cannot be analysed.

Definition at line 194 of file VadAnalyzer.hpp.

195 {
196 const auto& cfg = this->template config<VadAnalyzerConfig>();
197 if (const std::string reason = diagnose(cfg); !reason.empty()) {
199 std::source_location::current(), "VadAnalyzer: {}", reason);
200 }
201 const size_t chunks = network().record(samples);
203 return chunks;
204 }
const Config & config() const
The stored config struct of type Config, or its defaults when none was set.
size_t record(std::span< const float > samples)
Run every chunk the samples complete, without waiting for the result.
SileroVadModel & network() const
static std::string diagnose(const VadAnalyzerConfig &config)
Why a config cannot be analysed.
Whether each 32 ms chunk of a mono 16 kHz stream is voice activity, from a learned network.