# Load data
data(btnw)
data(survey)
# Write Wave objects to file (temporary directory used here)
btnw.fp<-file.path(tempdir(),"btnw.wav")
survey.fp<-file.path(tempdir(),"survey2010-12-31_120000_EST.wav")
writeWave(btnw, btnw.fp)
writeWave(survey, survey.fp)
# Template construction
b4<-makeBinTemplate(
btnw.fp,
frq.lim=c(2, 8),
select="auto",
name="b4",
buffer=4,
amp.cutoff=-31,
binary=TRUE)
# Binary point matching
scores<-binMatch(survey=survey.fp, templates=b4, time.source='fileinfo')
# Isolate peaks
pks<-findPeaks(scores)
#If using the 'acoustics' schema verbatim:
dbUploadResult(detection.obj = pks, analysis.type = "BIN", analyst = 1)
#'acoustics' schema, different database name:
dbUploadResult(
detection.obj = pks,
which.one = "b4",
what = "peaks",
db.name = "LocalSQLdb",
uid = "EntryOnly" ,
pwd = "07H23BBM",
analysis.type = "BIN",
analyst = 1)
# Clean up (only because these files were created in these examples)
file.remove(btnw.fp)
file.remove(survey.fp)Run the code above in your browser using DataLab