You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Default to 1 thread to use as multithreading slows down on CPU
- Use sapply instead of for loop to loop over the windowed samples inside a with_no_grad chunk
- Function silero no longer requires to provide the sample_rate, this is now extracted using audio::load.wave
- Factor out the use of package av to only the examples - internally replaced with package audio
Copy file name to clipboardExpand all lines: R/silero.R
+53-37Lines changed: 53 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@
3
3
#' It works with .wav audio files with a sample rate of 8 or 16 Khz an can be applied over a window of eiher 32, 64 or 96 milliseconds.
4
4
#' @param file the path to an audio file which should be a wav file in 16 bit with mono PCM samples (pcm_s16le codec) with a sampling rate of either 8Khz or 16KHz
5
5
#' @param milliseconds integer with the number of milliseconds indicating to compute by this number of milliseconds the VAD signal. Can only be 32, 64 or 96 Defaults to 64.
6
-
#' @param sample_rate integer with the sample rate of \code{file}. If not provided, will use package av to extract it.
7
6
#' @param threshold numeric indicating if the probability is above this threshold, the segment is detected as voiced. Defaults to 0.5
7
+
#' @param threads integer with the number of threads to use, which is passed on to \code{\link[torch]{torch_set_num_threads}}. Defaults to 1.
8
8
#' @return an object of class \code{VAD} which is a list with elements
9
9
#' \itemize{
10
10
#' \item{file: the path to the file}
@@ -32,42 +32,42 @@
32
32
#' plot(vad$vad$millisecond, vad$vad$probability, type = "l",
0 commit comments