Skip to content

Commit

Permalink
add is.voiced.default
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijffels committed Mar 18, 2024
1 parent d3162ca commit 0ca8192
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand

S3method(is.voiced,"webrtc-gmm")
S3method(is.voiced,default)
S3method(print,VAD)
export(VAD)
export(is.voiced)
Expand Down
7 changes: 7 additions & 0 deletions R/vad.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ is.voiced <- function(x, units = "seconds", ...){
x
}

#' @param silence_min minimum duration of a segment with only silence
#' @param voiced_min minimum duration of a voiced segment
#' @export
is.voiced.default <- function(x, units = c("seconds", "milliseconds"), silence_min = ifelse(units == "milliseconds", 1000, 1), voiced_min = ifelse(units == "milliseconds", 1000, 1), ...){
"is.voiced.webrtc-gmm"(x, units = units, silence_min = silence_min, voiced_min = voiced_min, ...)
}


segment_collapse <- function(x){
x <- do.call(rbind, lapply(split(x, list(x$vad_segment, x$has_voice), drop = TRUE), FUN = function(x){
Expand Down

0 comments on commit 0ca8192

Please sign in to comment.