evalWav: Check a WAV file's quality

View source: R/evalWav.R

evalWavR Documentation

Check a WAV file's quality

Description

Check a WAV file's quality

Usage

evalWav(
  wave,
  utteranceTG = NULL,
  transcription = NULL,
  trim = NULL,
  plotOsc = NULL
)

Arguments

wave

Required. Either a tuneR::Wave object or a valid file path to an existing wav file.

utteranceTG

If not NULL (the default), a filename for the Praat TextGrid to be created. Must have the extension .TextGrid.

transcription

If not NULL (the default), a character vector indicating the transcription of the utterance.

trim

If not NULL (the default), a filename for the wav file to be created from the output of findSpeech() and the original .wav denoted with argument wave.

plotOsc

If not NULL (the default), a character vector that will server as the title of the wave form plot (recommended = the name of the object in wave).

Value

A list with 7 elements: the markers for the beginning and end of the utterance in samples, the sample rate of the original file, the SNR (dB), a logical value indicating whether 1% of samples in the original wave file were clipped, a tuneR::Wave object for the trimmed file (if trimmed != NULL), the text of the Praat TextGrid (if utteranceTG != NULL), and the plot of the wave form beginning and end markers (if plot != NULL).

Examples

data("samp_wav")
eval <- evalWav(samp_wav, plotOsc = "samp_wav")
print(eval$plot)

abbey-thomas/speechcollectr documentation built on Nov. 19, 2024, 7:09 p.m.