diarize: Who spoke when?

View source: R/diarize.R

diarizeR Documentation

Who spoke when?

Description

Diarization of WAV audios.

Usage

diarize(
  fromWav,
  toRttm = NULL,
  autoDir = FALSE,
  pycall = "~/miniconda3/envs/pyvoice/bin/python",
  token = NULL
)

Arguments

fromWav

Either a file or a directory containing WAV files.

toRttm

A directory to write RTTM files. If the default toRttm = NULL is used, './voiceAudios/rttm' is created and used.

autoDir

Logical. Must the directories tree be created? Default: FALSE. See 'Details'.

pycall

Python call. See https://github.com/filipezabala/voice for details.

token

Access token needed to instantiate pretrained speaker diarization pipeline from pyannote.audio. #1 Install pyannote.audio 3.1 with pip install pyannote.audio (already listed @ https://raw.githubusercontent.com/filipezabala/voice/master/requirements.txt). #2. Accept https://hf.co/pyannote/segmentation-3.0 user conditions. #3 Accept https://hf.co/pyannote-speaker-diarization-3.1 user conditions. #4. Create access token at https://hf.co/settings/tokens.

Details

When autoDir = TRUE, the following directories are created: '../mp3','../rttm', '../split' and '../musicxml'. Use getwd() to find the parent directory '../'.

Value

RTTM files in NIST standard. See 'voice::read_rttm'.

Examples

## Not run: 
library(voice)

wavDir <- list.files(system.file('extdata', package = 'wrassp'),
pattern = glob2rx('*.wav'), full.names = TRUE)

voice::diarize(fromWav = unique(dirname(wavDir)),
toRttm = tempdir(),
token = NULL) # Must enter a token! See documentation.

(rttm <- dir(tempdir(), '.[Rr][Tt][Tt][Mm]$', full.names = TRUE))
file.info(rttm)

## End(Not run)

filipezabala/voice documentation built on April 12, 2025, 12:39 p.m.