if (FALSE) {
# Load data
library(NatureSounds)
data(list = c("Phae.long1", "Phae.long2", "Phae.long3", "Phae.long4", "lbh_selec_table"))
tuneR::writeWave(Phae.long1, file.path(tempdir(),
"Phae.long1.wav"), extensible = FALSE) #save sound files
tuneR::writeWave(Phae.long2, file.path(tempdir(),
"Phae.long2.wav"), extensible = FALSE)
tuneR::writeWave(Phae.long3, file.path(tempdir(),
"Phae.long3.wav"), extensible = FALSE)
tuneR::writeWave(Phae.long4, file.path(tempdir(),
"Phae.long4.wav"), extensible = FALSE)
#create new folder to put cuts
dir.create(file.path(tempdir(), "cuts"))
# cut files
cut_sels(X = lbh_selec_table, mar = 0.05, path = tempdir(),
dest.path = file.path(tempdir(), "cuts"))
#Now run 'Raven' batch correlator un the cuts and save the output in the same folder
# Import output (change the name of the file if you used a different one)
xcorr.rav <- imp_corr_mat(file = "BatchCorrOutput.txt",
path = file.path(tempdir(), "cuts"))
# check results
## correlation matrix
xcorr.rav[[1]]
## time lag matrix
xcorr.rav[[2]]
}
Run the code above in your browser using DataLab