Skip to content

Commit

Permalink
pad_wav() Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
howardbaek committed Jul 10, 2023
1 parent 22b7f13 commit 98b30bd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
17 changes: 9 additions & 8 deletions R/pad_wav.R
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
#' Pad Wave Objects
#'
#' @param wav list of Wave objects
#' @param wav List of Wave objects
#' @param duration If \code{NULL}, the duration will simply round
#' the Wave up to the next whole integer. If not, these are the
#' duration to pad the Wave *to*. For example 12 means the output
#' Wave will have a length of 12 seconds. Pass \code{NA} to those
#' the Wave up to the next whole integer. If not, these are the
#' duration to pad the Wave *to*. For example, 12 means the output
#' Wave will have a length of 12 seconds. Pass \code{NA} to those
#' Waves that you want simple rounding.
#'
#' @return A list of Wave objects, same length as input \code{wav}
#' @export
#'
#' @importFrom purrr map2 map2_int
#' @examples
#' wav_list <- list(
#' tuneR::noise(duration = 2000),
#' tuneR::noise(duration = 1000)
#' library(tuneR)
#' x <- list(
#' noise(duration = 2000),
#' noise(duration = 1000)
#' )
#' out <- pad_wav(wav_list)
#' out <- pad_wav(x)
pad_wav <- function(wav, duration = NULL) {
# See if wav inherits from "Wave" class
is_Wave <- inherits(wav, "Wave")
Expand Down
17 changes: 9 additions & 8 deletions man/pad_wav.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 98b30bd

Please sign in to comment.