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

◆ measure_speech()

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

Definition at line 401 of file SpeechSegmenter.hpp.

402 {
403 if (!m_waveform) {
404 m_waveform.emplace(voicing_analyzer_config(cfg.sample_rate));
405 }
406 auto voicing = measure_voicing(*m_waveform, samples, record.speech, cfg.speech.voicing_threshold);
407 record.voiced_fraction = std::move(voicing.voiced_fraction);
408 record.f0 = std::move(voicing.f0);
409 }
std::optional< StandardWaveformAnalyzer > m_waveform
The speech intervals of a whole mono 16 kHz recording.
SpeechVoicing measure_voicing(StandardWaveformAnalyzer &analyzer, std::span< const double > samples, const std::vector< std::pair< size_t, size_t > > &speech, double voicing_threshold)
Voiced share and median frequency of the waveform windows that start in each interval.
WaveformAnalyzerConfig voicing_analyzer_config(double sample_rate, uint32_t hop=256)
The waveform analyzer settings the voicing measure uses at the given rate and hop.

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

Here is the caller graph for this function: