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

◆ record()

size_t MayaFlux::Yantra::SileroVadModel::record ( std::span< const float > samples)
nodiscard

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 model's recording; nothing is submitted. Submit the recording, for instance by recording a consumer into it and submitting that, then use resident_count for how many probabilities there are. At most 4096 chunks run per call and the rest stay pending, so a consumer must read the buffer before the next call.

Parameters
samplesMono samples at 16 kHz, continuing the previous call.
Returns
The number of chunks recorded.

Definition at line 270 of file SileroVadModel.cpp.

271{
272 m_impl->pending.insert(m_impl->pending.end(), samples.begin(), samples.end());
273
274 const size_t chunks = std::min(m_impl->pending.size() / chunk_samples, k_max_chunks);
275 if (chunks == 0) {
276 return 0;
277 }
278 static_cast<void>(m_impl->consume(chunks, false));
279 return chunks;
280}
static constexpr uint32_t chunk_samples

References chunk_samples, and m_impl.

Referenced by MayaFlux::Yantra::VadAnalyzer< std::vector< Kakshya::DataVariant >, Eigen::MatrixXd >::record().

Here is the caller graph for this function: