Published

May 17, 2025

 

Objective

  • Demonstrate how to obtain acoustic data from online repositories

1 Getting recordings from online repositories

The suwo package offers several functions to query and download recordings (and other media) of animal vocalizations in online repositories. For instance, the following code return recordings metadata from Xeno-Canto:

Example on how to get recording’s metadata (no downloading):

Code
library(suwo)

phae_his <- query_xenocanto(term = 'Phaethornis hispidus')

Keep only song vocalizations:

Code
song_phae_his <- phae_his[grep("song", ignore.case = TRUE, phae_his$vocalization.type), ]

Map locations using map_locations():

Code
map_locations(song_phae_his)

Once you feel fine with the subset of data you can go ahead and download it as follows:

Code
download_media(metadata = song_phae_his, 
         path = "DIRECTORY WHERE YOU WANT TO SAVE THE FILES")

You can also download recordings from other taxonomic groups. Take a look at this link for a list of species by taxonomic group.


Session information

R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Costa_Rica
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] suwo_0.1.0      jsonlite_2.0.0  RCurl_1.98-1.17

loaded via a namespace (and not attached):
 [1] gtable_0.3.6      rjson_0.2.23      dplyr_1.1.4       compiler_4.3.2   
 [5] tidyselect_1.2.1  bitops_1.0-9      leaflet_2.2.1     parallel_4.3.2   
 [9] gridExtra_2.3     jquerylib_0.1.4   scales_1.3.0      yaml_2.3.10      
[13] fastmap_1.2.0     ggplot2_3.5.1     R6_2.6.1          generics_0.1.3   
[17] curl_6.2.2        knitr_1.50        htmlwidgets_1.6.4 viridis_0.6.5    
[21] backports_1.5.0   checkmate_2.3.2   tibble_3.2.1      munsell_0.5.1    
[25] pillar_1.10.1     rlang_1.1.5       xfun_0.51         viridisLite_0.4.2
[29] cli_3.6.4         magrittr_2.0.3    crosstalk_1.2.1   digest_0.6.37    
[33] grid_4.3.2        rstudioapi_0.16.0 pbapply_1.7-2     lifecycle_1.0.4  
[37] vctrs_0.6.5       evaluate_1.0.3    glue_1.8.0        colorspace_2.1-1 
[41] rmarkdown_2.28    httr_1.4.7        tools_4.3.2       pkgconfig_2.0.3  
[45] htmltools_0.5.8.1