diarize {voice}R Documentation

Who spoke when?

Description

Diarization of WAV audios.

Usage

diarize(
  fromWav,
  toRttm = NULL,
  autoDir = FALSE,
  pycall = "~/miniconda3/envs/pyvoice38/bin/python3.8",
  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. Visit https://hf.co/pyannote/speaker-diarization and accept user conditions. #2. Visit https://hf.co/pyannote/segmentation and accept user conditions. #3. Visit https://hf.co/settings/tokens to create an access token. More details at https://github.com/pyannote/pyannote-audio.

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)

[Package voice version 0.4.21 Index]