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

◆ interval_regions()

Kakshya::RegionGroup MayaFlux::Yantra::interval_regions ( const ChannelIntervals & intervals,
uint32_t first_channel,
uint32_t last_channel,
std::string name = "intervals" )
inlinenodiscard

One region per interval, spanning the given channels.

Parameters
intervalsHalf open sample ranges. Empty ranges are skipped.
first_channelFirst channel the regions cover.
last_channelLast channel the regions cover, inclusive.
nameName of the group.

Definition at line 209 of file IntervalExtractor.hpp.

211{
212 Kakshya::RegionGroup group(std::move(name));
213 for (const auto& [start, end] : intervals.intervals) {
214 if (end > start) {
215 group.add_region(Kakshya::Region::audio_span(start, end - 1, first_channel, last_channel));
216 }
217 }
218 return group;
219}
Organizes related signal regions into a categorized collection.
static Region audio_span(uint64_t start_frame, uint64_t end_frame, uint32_t start_channel, uint32_t end_channel, const std::string &label="")
Create a Region representing a span in audio (frames and channels).
Definition Region.hpp:196
std::vector< std::pair< size_t, size_t > > intervals

References MayaFlux::Kakshya::RegionGroup::add_region(), MayaFlux::Kakshya::Region::audio_span(), and MayaFlux::Yantra::ChannelIntervals::intervals.

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

Here is the call graph for this function:
Here is the caller graph for this function: