clipCheck: Check a recording for clipping

View source: R/clipCheck.R

clipCheckR Documentation

Check a recording for clipping

Description

Check a recording for clipping

Usage

clipCheck(
  wave,
  return = c("df", "logical", "proportion"),
  threshold = 32112.64,
  max_clipped = 0.01
)

Arguments

wave

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

return

Either "df", "logical", or "proportion". Should the function return a dataframe containing a list of clipped frames, a logical value indicating whether more samples than the amount indicated by max_clipped were clipped, or the amount of samples clipped as a proportion of the signal?

threshold

The amplitude threshold above which samples should be considered clipped. Defaults to 32112.64 (maximum for 16-bit PCM).

max_clipped

The proportion of samples we can allow to be clipped and still return FALSE if return value is logical. Defaults to 0.01 (i.e. 1% of samples).

Value

A data.frame containing a list of clipped samples or a logical value indicating whether more samples than the amount indicated by max_clipped were clipped

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.