findSpeech: Detect a single utterance in a recording

View source: R/findSpeech.R

findSpeechR Documentation

Detect a single utterance in a recording

Description

Detect a single utterance in a recording

Usage

findSpeech(
  wave,
  minAmp = 500,
  maxPause = 10000,
  beginPad = 2000,
  endPad = 4000
)

Arguments

wave

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

minAmp

The minimum envelope value required for a signal to be considered speech. Defaults to 500. See Details for more information.

maxPause

The maximum duration of a pause in the utterance. If a segment of non-speech longer than this value is found, it will be considered the end of the utterance.

beginPad

How many samples should be included before the beginning of the detected signal to ensure we capture the whole utterance? See Details for more information.

endPad

How many samples should be included after the end of the detected signal to ensure we capture the whole utterance?

Details

If you find the function is excluded too much speech, try lowering the minAmp value or increasing the begin and end padding values. If the function is including too much leading and trailing noise, try increasing the minAmp value or decreasing the begin and end pad values.

Value

A list with 2 numeric values: begin_s = the sample in the original recording that marks the start of the speech signal; and end_s = the sample in the original recording that marks the end of the speech signal.

Examples

data("samp_wav")
fs <- findSpeech(samp_wav)
#find the beginning of the utterance in seconds
#(to compare with manual measurements in Praat, for example).
fs$begin_s/samp_wav@samp.rate
#now the end...
fs$end_s/samp_wav@samp.rate

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