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

◆ find_speech()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = Kakshya::RegionGroup>
void MayaFlux::Yantra::SpeechSegmenter< InputType, OutputType >::find_speech ( std::span< const double > samples,
const SpeechSegmenterConfig & cfg,
SpeechSegmentation & record )
inlineprivate

Definition at line 380 of file SpeechSegmenter.hpp.

381 {
382 m_vad.reset();
383 const auto probabilities = m_vad.analyze_speech(
386 if (probabilities.empty()) {
387 return;
388 }
389
390 Eigen::MatrixXd scores(static_cast<Eigen::Index>(probabilities.size()), 1);
391 for (size_t chunk = 0; chunk < probabilities.size(); ++chunk) {
392 scores(static_cast<Eigen::Index>(chunk), 0) = probabilities[chunk];
393 }
394 m_intervals.set_config(speech_scan_settings(cfg.speech, samples.size()));
395 const auto intervals = m_intervals.extract_intervals(scores);
396 if (!intervals.channels.empty()) {
397 record.speech = intervals.channels[0].intervals;
398 }
399 }
MatrixIntervalExtractor m_intervals
The speech intervals of a whole mono 16 kHz recording.
IntervalExtractorConfig speech_scan_settings(const SpeechSettings &speech, size_t samples)
The interval scan settings of speech runs, for a recording of the given length.

Referenced by MayaFlux::Yantra::SpeechSegmenter< std::vector< Kakshya::DataVariant >, Kakshya::RegionGroup >::segment().

Here is the caller graph for this function: