Audio Segment Picker
  • 19 Jul 2024
  • 1 Minute to read
  • Contributors
  • PDF

Audio Segment Picker

  • PDF

Article summary

Accumulates segments, whenever a Flush is received, picks a segment with a length in range of primary interval. If no such segment exists, tries to pick it in range of secondary interval. Otherwise, picks the first segment.
After picking a segment, the node sends it to the listeners.

Parameters:

name
description
default
PrimaryIntervalLowerLimitMsecLower Limit of Primary Interval5000
PrimaryIntervalUpperLimitMsecUpper Limit of Primary Interval20000
SecondaryIntervalLowerLimitMsecLower Limit of Secondary Interval3000
SecondaryIntervalUpperLimitMsecUpper Limit of Secondary Interval30000

Inputs

Audio:
Accepts audio from a single channel.

Events:

namedescriptionknown nodes that generate this event
Start of SegmentSignals the start of a speech segment.Audio Segmenter
End of SegmentSignals the end of a speech segment.Audio Segmenter

Outputs

Audio:
Audio fragments are sent to output

Events:

namedescription
Start of SegmentRaised once at the beginning of each audio fragment.
End of SegmentRaised once at the end of each audio fragment.

Remarks :

  • This node does performs its calculations when flush is called. So until all the segments are provided and the flush method is called this node does not output anything. Hence it is only suitable for batch usage.

  • Similar to AudioSegmenter Node, this node also toasts the audio output write actions for each segment in between start-of-segment and end-of-segment events. As an example for an audio data with 3 audio segments, the flow is as follows (the order is well defined) :

segment-1: send "Start of Segment" event
segment-1: write the audio data of this segment to output
segment-1: send "End of Segment" event
segment-2: send "Start of Segment" event
segment-2: write the audio data of this segment to output
segment-2: send "End of Segment" event
segment-3: send "Start of Segment" event
segment-3: write the audio data of this segment to output
segment-3: send "End of Segment" event

Project Structure
A sample project can be built as such:

image.png

The project picks the best segment that the [Language Identifier](/v1/docs/dataflow-nodes-language-identifier){target=`_blank`} works with, and outputs one Language Change event.

Supported flow types: Batch


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.