Skip to content

Commit

Permalink
maad_wave allow WaveMC class
Browse files Browse the repository at this point in the history
  • Loading branch information
edwbaker committed Aug 10, 2024
1 parent 52d06d4 commit eac8ad9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/scikit-maad-sound.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ maad_spectrogram <- function(wave, mode="power", ..., maad=NULL) {

maad_wave <- function(wave) {
#ToDo: Process wave to be expected as maad.
if (inherits(wave, c("WaveMC", "TaggedWaveMC"))) {
return(reticulate::np_array(wave@`.Data`[,1]))
} else if (inherits(wave, c("Wave", "TaggedWave"))) {
return(reticulate::np_array(wave@left))
}
}

#' Compute a spectrum of a sound wave using scikit-maad
Expand Down

0 comments on commit eac8ad9

Please sign in to comment.