probs_to_segments: Speaker Probabilities to Segments

View source: R/segments.R

probs_to_segmentsR Documentation

Speaker Probabilities to Segments

Description

Thresholds per-frame speaker probabilities and returns one row per contiguous run of activity. Overlapping speech gives overlapping segments.

Usage

probs_to_segments(probs, threshold = 0.5, frame_duration = 0.01)

Arguments

probs

Numeric matrix, frames x speakers, of speaker activity probabilities (one frame per 10 ms), as returned by diarize with probs = TRUE or by n3d_stream_push.

threshold

Probability above which a frame counts as speech.

frame_duration

Seconds per frame.

Value

A data frame with columns start and end (seconds) and speaker (integer, numbered from 1 in order of first arrival), sorted by start time then speaker.

Examples

p <- matrix(0, 300, 8)
p[1:120, 1] <- 0.9
p[100:300, 2] <- 0.8
probs_to_segments(p)

n3d documentation built on Oct. 14, 2026, 5:08 p.m.