Coder Social home page Coder Social logo

marce10 / warbler Goto Github PK

View Code? Open in Web Editor NEW
51.0 12.0 21.0 184.77 MB

streamline acoustic analysis in R

Home Page: https://marce10.github.io/warbleR/

License: GNU General Public License v3.0

R 99.45% CSS 0.16% C++ 0.40%
bioacoustics animal-acoustic-signals streamline-analysis audio-processing spectrogram

warbler's Introduction

warbleR: Streamline Bioacoustic Analysis

lifecycle Dependencies Project Status: Active The project has reached a stable, usable state and is being actively developed. Licence CRAN_Status_Badge Total Downloads Codecov test coverage R-CMD-check

warbleR logo

warbleR is intended to facilitate the analysis of the structure of animal acoustic signals in R. Users can collect open-access avian recordings or enter their own data into a workflow that facilitates spectrographic visualization and measurement of acoustic parameters. warbleR makes use of the fundamental sound analysis tools of the seewave package, and offers new tools for acoustic structure analysis. These tools are available for batch analysis of acoustic signals.

The main features of the package are:

  • Diverse tools for measuring acoustic structure
  • The use of loops to apply tasks through acoustic signals referenced in a selection table
  • The production of images in the working directory with spectrograms to allow users organize data and verify acoustic analyses

The package offers functions to:

  • Explore and download Xeno‐Canto recordings
  • Explore, organize and manipulate multiple sound files
  • Detect signals automatically (in frequency and time) (but check the R package ohun for a more thorough and friendly implementation)
  • Create spectrograms of complete recordings or individual signals
  • Run different measures of acoustic signal structure
  • Evaluate the performance of measurement methods
  • Catalog signals
  • Characterize different structural levels in acoustic signals
  • Statistical analysis of duet coordination
  • Consolidate databases and annotation tables

Most of the functions allow the parallelization of tasks, which distributes the tasks among several processors to improve computational efficiency. Tools to evaluate the performance of the analysis at each step are also available.

Installing

Install/load the package from CRAN as follows:

install.packages("warbleR")

# load package
library(warbleR)

To install the latest developmental version from github you will need the R package remotes:

remotes::install_github("maRce10/warbleR")

# load package
library(warbleR)

Usage

Take a look at the package vignettes with detailed examples on how to organize functions in an acoustic analysis workflow.

A full description of the package (although a bit outdated) can be found in this journal article.

Other packages

The packages seewave and tuneR provide a huge variety of functions for acoustic analysis and manipulation. They moslty works on wave objects already imported into the R environment. The package baRulho focuses on quantifying habitat-induced degradatio of acoustic signals with data inputs and ouputs similar to those of warbleR. The package Rraven facilitates the exchange of data between R and Raven sound analysis software (Cornell Lab of Ornithology) and can be very helpful for incorporating Raven as the annotating tool into acoustic analysis workflow in R. The package ohun works on automated detection of sound events, providing functions to diagnose and optimize detection routines. dynaSpec is allows to create dynamic spectrograms (i.e. spectrogram videos).

Citation

Please cite warbleR as follows:

Araya-Salas, M. and Smith-Vidaurre, G. (2017), warbleR: an r package to streamline analysis of animal acoustic signals. Methods Ecol Evol. 8, 184-191.

NOTE: please also cite the tuneR and seewave packages if you use any spectrogram-creating or acoustic-measuring functions

warbler's People

Contributors

andrew-1234 avatar edwbaker avatar gsvidaurre avatar marce10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

warbler's Issues

hanging or error when using "parallel" in MacOS

Hi -
I am having issues attempting to use parallel inside warbleR functions on MacOS (e.g. autodetect, song_param). Works fine without parallel (or "parallel = 1") but 2 or higher hangs. I can see in activity monitor that threads are running but the R console hangs, showing:
" | | 0 % ~calculating sound files and producing spectrogram:"

Yesterday when I attempted to run the same command I got the following error message:
"The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC() to debug."

I can't seem to reproduce that error today, it's hanging instead. I can stop the process however - it's not freezing up R entirely.

No issue running the same command on a PC.

Running Mac Catalina 10.15.6, current version of R.

Cheers,
Laura

Error message WarbleR

Hello,

I've been using WarbleR to download files from Xeno-canto and then convert them from mp3 to wav. Yesterday I had a message saying "R session Aborted. R encountered a fatal error. The session was terminated" after I ran the function "mp32wav", so I restarted my laptop, then I detached the package, installed it again like this:

detach(package:warbleR, unload=TRUE)
install.packages("devtools")
devtools::install_github("maRce10/warbleR")
1
Yes
library(warbleR)

and it worked for a while. However, today I had exactly the same problem. I downloaded the files, then, when I was trying to convert them, it gave me the "R session aborted" so I continued to do exactly the same but this time it did not work.
Then, it gave me this error:

_configure: error: Could not find cmake
ERROR: configuration failed for package ‘bioacoustics’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/bioacoustics’
  • restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/bioacoustics’

The downloaded source packages are in
‘/private/var/folders/wx/w6wgx2kx5j9dkh2191wtcm680000gn/T/RtmpaRIwUG/downloaded_packages’_

And now, when I try to even load the package using library(warbleR), I get this error:

Error: package or namespace load failed for ‘warbleR’ in get(method, envir = home):
lazy-load database '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/warbleR/R/warbleR.rdb' is corrupt
In addition: Warning message:
In get(method, envir = home) : internal error -3 in R_decompress1

Is there anything else I can do?
Thank you for reading,

Sofía

spectro_analysis Error: "integer overflow"

Hi, I'm trying to run the spectro_analysis() function on Mac for a data table of about 5000 selections made by auto_detec() from bird audio files.

It is getting about halfway through before giving this error: "Error in m[(fl[1]:fl[2]) + 1, ] : subscript out of bounds"
When I look at the warnings, there are fifty "In (0:(n - 1)) * f : NAs produced by integer overflow" errors.

Any advice on how to resolve this would be much appreciated!

how to use specan ?? it is not clear

hii, i want to use warbleR for acoustic analysis, so i have to use specan but there is param x which is not clear how i can pass .wav file??
look at
specan("voice.wav")

Decimal error in Vignette causes crash

Minor error in the WarbleR vignette "warbleR_workflow_01.html". In the mp32wav conversion step, samp.rate should be in kHz.

here we are downsampling the original sampling rate of 44.1 kHz to speed up downstream analyses in the vignette series

mp32wav(samp.rate = 22050)

could not find function "freq_ts"

Error in freq_ts(ext_st, wl = 512, length.out = 20, wn = "hanning", ovlp = 70, :
could not find function "freq_ts"

A couple of weeks ago "ffts" stopped working and after about an hour of research, I learned that the function had been deprecated to freq_ts (https://rdrr.io/cran/warbleR/src/R/deprec_funs.R). ** Please note that this change was not reported when using the command "print(new_function_names)" so it took a very long time to discover the problem **

Yesterday, I tried to use "freq_ts" and got the above error (which I also got today, even after installing the latest version using "install_gihub").

For some inexplicable reason, "ffts" works again but doesn't seem to track F0 as well as "freq_ts" (i.e., the contour jumps to upper harmonics).

fftw dependency install problem on Linux Debian stable (10)

Hello

I perhaps should be asking this question to the fftw package maintainer Ulwe Ligges, but could not find a GitHub page for that package. i am trying to install warbleR and failing to install fftw with the following message:

/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:6: fftw.so] Error 1
ERROR: compilation failed for package ‘fftw’

Prior to that, the console repeatedly prints fftw_an_INT_guaranteed_to_be_zero' can not be used when making a shared object; recompile with -fPIC after each line that is run.

I have tried ensuring the package FFTW3 is in the path of fftw. I have also successfully installed the R package fftw3 (https://github.com/MangoTheCat/fftw3), but I assume warbleR does depend on that.

Is there any advice you cna give me, or should i contact the fftw package team?

Many thanks

Can't download files from xeno-canto

If I write the following code:

CGDO.rec <- query_xc(qword='nr:408879',download = FALSE)
nrow(CGDO.rec)
str(CGDO.rec)

R successfully locates the recording I want to download from xeno-canto. However when i try to download the recording to my directory:
query_xc(X=CGDO.rec); or I change the FALSE to TRUE in the previous code

I get a series of error messages (see attached document). I have restarted R and installed devtools along with all the other packages. Any idea why this is happening?

Screen Shot 2022-02-08 at 3 57 18 PM
?

resample_est_waves

I am trying to resample bat recordings taken at a sampling rate of 500 kHz down to 250 kHz. Below is the code; the warnings; spectrograms of the same detection made before and after resampling; and an extended selection table of that detection.

CODE

standardize sampling rate

extSelTable <- resample_est_waves(extSelTable, samp.rate = 250, avoid.clip = TRUE)

WARNINGS
sox WARN dither: no `shibata' filter is available for rate 250000; using sloped TPDF
sox WARN dither: dither clipped 27978 samples; decrease volume?

I think the filter warning isn't a problem, but the clipping might be. Would it be possible to add the -G flag inside the sox call to avoid clipping? Or is there something else we can try to avoid restructuring the signal?

SPECTROGRAMS
Pre-resampling:
pre_resampling_zelda31562

Post-resampling:
post_resampling_zelda31562

EST
https://drive.google.com/file/d/1yuGnFz-ennzGHKs7Dm2D6iyDua47WQzU/view?usp=sharing

Thank you!

Possible error found in lspec2pdf

Hi,
I'm re-running a script in which I use the function lspec2pdf. It worked in the past, but now (maybe, after an update), it doesn't.

I've seen that maybe, an error has been introduced in lines 8 and 9 of the function:
if (!is.null(path))
path <- getwd()

If I am right, the symbol ! should be removed. Written with it, the function will overwrite the path with the working directory when path parameter is not null (i.e.: when the user introduces it).

measurement function fails with hard to trace error message with sound-selection of length 1

Hi,

In an analysis I did today I had a wonky selection table that specified a selection of length 1 sample. Several measuring functions of the warbleR package just crash without don't provide an easy to understand error message under such conditions. Thus, it took me several hours to find the cause for this problem, even though I'm used to programming and debugging in R.

The specan function in such a case returns:
Error in seq.default(1, n + 1 - wl, wl - (ovlp * wl/100)) :
wrong sign in 'by' argument

The ffts function gives the same error as specan.

dfts gives this error:
Error in hanning.w(wl) : 'n' must be a positive integer

I didn't try any other functions.

I traced the issue to its root in the case of the specan function:
specan() calls frd_wrblr_int().
frd_wrblr_int() has two lines that are supposed to correct wl if it is too long for the given sound snippet to measure:
if(wl >= length(wave@left)) wl <- length(wave@left) - 1
if (wl %% 2 != 0) wl <- wl - 1
With very short sound snippets this ends up with a negative value for wl, causing an error several levels further down in the call stack.

It would be great if the measuring functions would provide an easy to understand error message in such cases.

Error in rbind

Cannot complete querxc() function call.

querxc("q:A", download=FALSE)
| | 0 % ~calculating Error in rbind(deparse.level, ...) :
numbers of columns of arguments do not match

Error: package 'warbleR' 1.1.27 was found, but >= 1.1.28 is required by 'ohun'

Hi,
I am trying to install package ohun but the error occurs as below:
Error: package 'warbleR' 1.1.27 was found, but >= 1.1.28 is required by 'ohun'
Execution halted
ERROR: lazy loading failed for package 'ohun'

Although the warbleR package on github displays the version is 1.1.28, I can only download version 1.1.27
Before the error the code was running like this:

Running R CMD build...

  • checking for file 'C:\Users\User\AppData\Local\Temp\RtmpOO7XTW\remotes48c11866478\maRce10-ohun-742a5bd/DESCRIPTION' ... OK
  • preparing 'ohun':
  • checking DESCRIPTION meta-information ... OK
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • looking to see if a 'data/datalist' file should be added
  • building 'ohun_0.1.0.tar.gz'
  • installing source package 'ohun' ...
    ** using staged installation
    ** R
    ** data
    ** inst
    ** byte-compile and prepare package for lazy loading

Hope this problem can be fixed.
Best regards,
David

freq_range no recursive option?

I am consulting on an acoustics project where the data files are organized within folders by date. The imp_raven function works presumably because of the recursive = TRUE option. I am having issues with the freq_range function because the wav files are in subdirectories of the provided path. Is there an easy fix for this or can this functionality be added in a future release?

numbers of columns of arguments do not match

library(warbleR)
df1 = quer_xc(qword ='Catharus bicknelli type:call cnt:"United States"', download = FALSE)
| | 0 % ~calculating Error in rbind(deparse.level, ...) :
numbers of columns of arguments do not match

error while downloading recordings with query_xc

Hi,

I downloaded recordings in the past with no problem using query_xc. Now however, it is giving me an error that "HTTP status was '404 Not Found'". I am trying to download recordings from metadata that I filtered to have only a certain type of vocalization. I downloaded warbleR from github after looking at previous issues but it still has the same problem.

Code:

#Packages
library(devtools)
devtools::install_github("maRce10/warbleR")
library(warbleR)
library(tuneR)
library(maps)
library(tidyr)
library(dplyr)
library(xlsx)
library(writexl)
library(lubridate)
library(plyr)
library(sqldf)

#corvids
Corvus1<- query_xc(qword = "Corvus", download = FALSE)
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02m 22s
6203 recording(s) found!

#keep only alarm calls
alarm<-sqldf("SELECT * FROM Corvus1 WHERE Vocalization_type LIKE '%alarm%'")

#download recordings
query_xc(X = alarm, download = TRUE)
Downloading files...
| | 0 % ~calculating Error in download.file(url = paste("https://www.xeno-canto.org/download.php?XC=", :
cannot open URL 'https://www.xeno-canto.org/download.php?XC=357593'
In addition: Warning message:
In download.file(url = paste("https://www.xeno-canto.org/download.php?XC=", :
cannot open URL 'https://www.xeno-canto.org/download.php?XC=357593': HTTP status was '404 Not Found'

Thanks in advance!

Installation failure

When the installation routine comes to fftw, the following error messages are displayed:

No package 'fftw3' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables FFTW_CFLAGS
and FFTW_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

ERROR: configuration failed for package ‘fftw’

  • removing ‘/home/thomas/R/x86_64-pc-linux-gnu-library/3.4/fftw’
    Warning in install.packages :
    installation of package ‘fftw’ had non-zero exit status
  • installing source package ‘RCurl’ ...
    ** Paket ‘RCurl’ erfolgreich entpackt und MD5 Summen überprüft
    checking for curl-config... no
    Cannot find curl-config
    ERROR: configuration failed for package ‘RCurl’
  • removing ‘/home/thomas/R/x86_64-pc-linux-gnu-library/3.4/RCurl’
    Warning in install.packages :
    installation of package ‘RCurl’ had non-zero exit status
    ERROR: dependencies ‘fftw’, ‘RCurl’ are not available for package ‘warbleR’
  • removing ‘/home/thomas/R/x86_64-pc-linux-gnu-library/3.4/warbleR’
    Warning in install.packages :
    installation of package ‘warbleR’ had non-zero exit status

How can this be resolved? I am not aware of any possibility change environment variables for package installation.
Thanks,
Thomas

column names in Vignette 2

Hey:

just so you know the example code in the "Import sound files and select signals" vignette throws an error because the column names generated in the following code are not appropriate for the 'selection_table' function.

Make your data frame into an object of class selection table
Downstream warbleR functions require selection tables in order to run correctly. Use the function selection_table to convert your data frame into an object of class selection_table. In future versions of warbleR, all functions will require selection table objects of class selection_table.

sels <- selection_table(X = sels)
str(sels)
class(sels)

thanks!
Greg

bug in xcorr.R?

Hi,

I am writing to report a potential bug in the xcorr() function. We were using it to build a cross-correlation matrix for a dataset of North American passerines that looks like this:

head(sound_times)

               sound.files      start      end selec
1   Spizella_pallida_a.wav 0.14862887 1.085007     1
2   Spizella_pallida_b.wav 0.73852067 2.153167     1
3 Spizella_passerina_a.wav 0.15001337 1.666764     1
4 Spizella_passerina_b.wav 1.10819695 3.254702     1
5   Spizella_pusilla_a.wav 0.05395893 1.615225     1
6   Spizella_pusilla_b.wav 0.07101049 1.369515     1

We ran the following command:

xcorr(X=sound_times,wl=512,frange = c(0,12),ovlp=90,dens=0.9,wn="hanning",cor.method="pearson",cor.mat=FALSE)

and got the following error:

creating templates:
   |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 10s
running cross-correlation:
   |++++                                              | 8 % ~34s          
Error in if (end > a$samples/a$sample.rate) end <- a$samples/a$sample.rate -  : 
  missing value where TRUE/FALSE needed

The error seems to originate in lines 274-280 of the xcorr() function:

274  margin <-(max(with(X, end[j:nrow(X)] - start[j:nrow(X)])))/2
275   start <-X$start[j] - margin
276   if(start < 0) {
277     end <-X$end[j] + margin -start[j]
278     start <- 0} else
279   end <-X$end[j] + margin
280 if(end > a$samples/a$sample.rate) end <- a$samples/a$sample.rate - 0.001

It looks like the variable start is set to a single number on line 275; yet it is subsetted by j (which takes values of 1:nrow(X)-1) on line 277.

We were able to get the function to work by redefining it without the j subset (i.e. line 277 was changed as follows):

277     end <-X$end[j] + margin -start

and got results as we expected.

Can you check whether this is the correct fix or whether we were lucky in getting back expected results?

Thanks for your work on this helpful package!

Autodetect doesn't create image files

I've being trying to use the autodect function. The detection is working (for most files), but autodect does not create images files.

any help?

autodetec(flist = sub, bp = c(2.5, 8.7), threshold = 10, mindur = 0.3, maxdur = 0.8, envt="abs",
ssmooth = 300, ls = TRUE, res = 100,
flim = c(1, 5), wl = 300, set =TRUE, sxrow = 8, rows = 10,
redo = TRUE,img = TRUE, it = "tiff")

spectro_analysis error on Windows

When spectro_analysis is run on my Windows computer, it throws the following error:
Error in pblapply_wrblr_int(X = 1:nrow(X), cl = cl, pbar = pb, FUN = function(i) { :
'list' object cannot be coerced to type 'double'

This occurs both when using an extended selection table and when writing the wavs out and using a data frame.
The same code functions on both Linux and Mac systems.
R version and all relevant packages are up to date.

In linked Google drive folder:
3 WAVs
3 selection tables
example code
error screenshot
https://drive.google.com/drive/folders/1pCXmiDo6zMvKemnuHywO0JbdiRt5A37I?usp=sharing

File naming with X argument

It seems that when you use warbleR::query_xc(X = df, download = TRUE, file.name = NULL), the saved files do not have the correct names. Each file in my application is named as a list of geographical coordinates followed by the recording id. It should just be the recording id. All of my attempts at using file.name fail to change these names.

Installing with RStudio

Hello,

I tried to install warbleR to RStudio and received the following error messages:

Warning: package 'maps' was built under R version 3.3.3
Warning: package 'seewave' was built under R version 3.3.3
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called 'signal'
Error : package 'seewave' could not be loaded
ERROR: lazy loading failed for package 'warbleR'

I tried to install 'seewave' separately, but this didn't seem to solve the problem. Do you have any suggestions?

Thanks
Madelyn

channel column in read_wave

Hi Marcelo!

Hope you're good.

I am using the read_wave function with a selection table. (As I can't have multichannel files in the selection table, I have 4x rows of the same audio file, but pointing at different channels.)

I can see the user can choose which channel to analyse with read_wave, does this count only for single multichannel WAV files loaded? I suppose so, as I didn't know selection tables can have multichannel audio in a single row.

Thanks
Axel

query_xc issue

Hello,

I keep getting the following error when running query_xc:

CR.recs <- querxc(qword = 'cnt:"costa rica"', download = FALSE)
Error in file(con, "r") :
cannot open the connection to 'https://www.xeno-canto.org/api/2/recordings?query=cnt:"costa%20rica"'
In addition: Warning message:
In file(con, "r") :
URL 'https://www.xeno-canto.org/api/2/recordings?query=cnt:"costa%20rica"': status was 'Peer certificate cannot be authenticated with given CA certificates'

Yet when I copy and paste the URL for the api link, the page appears to display everything just fine. I've updated R and reinstalled warbleR from the github and still get the message. Thanks very much for your help and your work on this package!

Suggested fix for specan slow processing

Great library. I've been using it to do some basic sound analysis. I'm using the method specan() and it runs extremely slowly, sometimes taking over an hour to process 30 wav files. This is due to the call fpeaks(). I've commented out this line and it runs much faster (about 10s).

It might be nice to add a parameter to the method to either optionally disable this measurement or to provide a vector of indices for which measurements to return.

specan <- function(X, bp = c(0,22), wl = 512, threshold = 15, features = c(1:22), parallel = 1)

The above signature is just an example, adding features = c(1:22) to indicate to use all 22 measurements. So to remove peakf, you would pass features = c(1:13, 15:22). Or maybe just a boolean. Just a suggestion. Thanks!

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘Wave’ for signature ‘"Wave"’

Hi Marcelo

I'm trying to run this code but I get this error
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘Wave’ for signature ‘"Wave"’

Code below, I tried with multichannel or mono files, of different sizes, still same error.

`
library(warbleR)
library(tuneR)
library(seewave)
memory.limit(size=56000)

audiofile_df_sel_tab_02 <- selection_table(whole.recs = TRUE)

file1 <- read_wave(audiofile_df_sel_tab_02, index = 1, channel = 1)
file2 <- read_wave(audiofile_df_sel_tab_02, index = 1, channel = 1)

audiofile_W <- Wave(file1 + file2 + 3) # summing the amplitude of two objects and adding 3 dB`

But if I run the below code on a single audio file it works fine:

`audiofile_a_format <- readWave("./0404_CAMB-T001.wav", toWaveMC = T)
memory.limit(size=56000)

audiofile_FLU <- audiofile_a_format[,1]
audiofile_FRD <- audiofile_a_format[,2]
audiofile_BLD <- audiofile_a_format[,3]
audiofile_BRU <- audiofile_a_format[,4]

audiofile_W <- Wave(audiofile_FLU + audiofile_FRD + audiofile_BLD + audiofile_BRU + 3)`

I was wondering if read_wave is different in other ways from readWave, not only that it's able to read selection tables.

Thanks

quer_ml

Hi!
When I try to use quer_ml in warbleR (1.1.24) with R, it tells me: 'could not find function "quer_ml"'
What is wrong? Would be very happy about any help!
Best wishes,
Ralph

querxc would not work

Hi,
Sorry if this is too basic...
I'm trying to select (to then download) some recordings from XC by using the querxc function:

PHY <- querxc(qword = "Phylloscopus", download = FALSE)

But I only obtain the following error:

Error in rbind(deparse.level, ...) :
numbers of columns of arguments do not match

I understand this error occurs when I'm trying to sort of import something that has n columns into something that has x columns, but how can this be the case? I've also tried to left my variable undefined and using the print function instead, but it doesn't work either.
I see this is not a very active forum, but maybe somebody would google a similar problem at some point...
Notice this is the very first line of code so I'm stack right at the beginning...

Error with catalog()

I have been trying to create a catalog from my sound files. It works with the sample sound files, but not with my own. I have a data frame with all of the correct column names and (presumably the right classes - sound.files (character), selec (integer), start (numeric), end (numeric) ). I have tried using the selection_table() function to turn my data frame into a selection table. But I get the same error every time:

Error in dimnames(x) <- dn :
invalid type (closure) for 'dimnames' (must be a vector)

This is my code:

#slc is a file with selection info (sound.files, selec, start, end)
l_song <- selection_table(slc[1:10,])

catalog(l_song, wl = 512, it = "jpeg", res = 100, ovlp = 50, nrow= 3, ncol = 3, fast.spec = TRUE)

The variation “dest.path” of function "mp3_2_wav" doesn't work

Hi, I'm trying to convert mp3 to wav with warbleR on Linux, the wav files doesn't exist in my target folder but the mp3 folder. The path has been sent to "dest.path" and no warning or error messages, it seems no use on my R session.

Here's part of my code, diclist is the list of a series of my folders:

name <- diclist[i,1]
  mp3path <- paste0("~/R/song_download/data/songdata/",name)
  wavpath <- paste0("~/R/song_download/data/xeno_wav/",name)
  if (file.exists(wavpath)==F){
    dir.create(wavpath) 
  }
  mp3_2_wav(samp.rate = 44.1,path = mp3path,dest.path = wavpath,
            overwrite = T,parallel = 4)

Any advice on how to resolve this problem would be much appreciated!

autodec() fails when files are not in current directory

Hello,
When using the autodect() function, there is this assumption that one will setwd() to the directory with the .wav files, and thus the function fails when providing full filenames with paths to the flist argument, as it searches for the contents of flist within the results of list.files().

This assumption is not specified in the function's help page, and was confusing to me when first using it, since i was passing the results of flist <- list.files(path=pathToData, pattern = ".wav$", ignore.case = TRUE, recursive = T, full.names = T), and thus the filenames were valid, yet not found

I understand the reasoning behind this behavior, as the primary result of autodec() is the long spectrograms with the syllables marked, but I believe this diminishes the practicality of using the function to simply detect syllables (without generating the image files), especially when using RStudio projects, in which changing directories mid-analysis is often considered bad form, or running the same script on different machines with different OS's.

Since the actual detections are made by the adFUN() function defined within autodetec(), it would be useful to expose this function to the user, perhaps under a name like detectSyllables(). This would streamline syllable detection, which can then be used to train automatic classifiers, without requiring an overhaul of the autodetec() function. Is this is not feasible or desired, I would suggest making it clear in the help page that the function requires one to change the working directory

Also, thanks for the package, I've been finding it very useful :)

The question about measurement of function gaps()

Hi Marcelo
I used function gaps() but I had some puzzle. My definition of "gaps" is the time between end of selection and the start of the next selection (the red arrow in the picture below).
屏幕截图 2023-03-13 111443

but when I run gaps() with the example data, the result like this (reorder by sound.file and start):

image

It seems the function measures the time between "start" of first selection and "end" of second selection, not the "gap" I think.
Do I have any misunderstanding of the "gap"?

Thanks

Installing warbleR in ubuntu

Hi,
I have successfully installed the dependencies packages of warbleR.
I am trying to install warbleR through R.

install.packages('warbleR')
I found this error during installation.
Error: package or namespace load failed for ‘warbleR’:
.onLoad failed in loadNamespace() for 'warbleR', details:
call: contrib.url(repos, type)
error: trying to use CRAN without setting a mirror
Error: loading failed
Execution halted
ERROR: loading failed

Please help me out how to solve this issue.

Thanks
Naresh

Problematic selections

Hello!

I'm trying to measure acoustic parameters for a batch of bat calls. A handful of them are being flagged as problematic and I am not sure what may be wrong with them. Any guidance would be greatly appreciated. I am attaching one of these problematic .wav files.

Thank you so much!

Gabriela
108_Echo.zip

Error in compare.methods function

Hello,
I am trying to work through your example of the compare.methods function and have been receiving the following error. Error in sample.int(length(x), size, replace, prob) : cannot take a sample larger than the population when 'replace = FALSE'
I have tried the examples from your website and in the R documentation for the functions, as well as trying it with a selection table of my own data. All return the same error. I assume this error is with the underlying random sample selection, but I do not know how to correct it to run the function. I will also note that I am using warbleR package version 1.1.22
Thank you

Using warbleR to download

Hi Macelo,

Is it possible to use warbleR to download an entire set of recordings I have made in xeno-canto? I have been able to this using your handy package for all the recordings of a certain genus or other XC
descriptors such as location or country, but what about sets?

Thanks,
David Bradley

Advanced XC Queries are not working for me

I have 3 XC queries in the following code, all of which return 7 items. The first query should return 7. The second and third should return 2 and 1, respectively. However, the latter two queries still provide the same results as if the loc and year tags are being ignored. How can I correctly filter the results to obtain the 2 and 1, respectively?

Technical notes: R version (4.3.1) and warbleR version (1.1.29)

####
#### Reading Data from Xeno-canto
####

library(warbleR)

## get ostrich data
all_ostrich = query_xc('struthio camelus', download = TRUE)

## get ostrich data in a specific area
limpopo_ostrich = query_xc(qword = 'gen:struthio loc:"mmabolela reserve"', download = TRUE)

## get ostrich data from a specific time period with the highest quality
good_ostrich = query_xc("gen:struthio year:2019", download = TRUE)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.