Skip to contents

summarize_acoustic_data summarizes information about file format in an acoustic data set

Usage

summarize_acoustic_data(path = ".", digits = 2)

Arguments

path

Character string containing the directory path where the sound files are located. Default is "." (current working directory).

digits

Numeric vector of length 1 with the number of decimals to include. Default is 2.

Value

The function prints a summary of the format of the files in an acoustic data set.

Details

The function summarizes information about file format in an acoustic data set. It provides information about the number of files, file formats, sampling rates, bit depts, channels, duration and file size (in MB). For file format, sampling rate, bit depth and number of channels the function includes information about the number of files for each format (e.g. '44.1 kHz (2)' means 2 files with a sampling rate of 44.1 kHz).

References

Araya-Salas, M., Smith-Vidaurre, G., Chaverri, G., Brenes, J. C., Chirino, F., Elizondo-Calvo, J., & Rico-Guevara, A. 2022. ohun: an R package for diagnosing and optimizing automatic sound event detection. BioRxiv, 2022.12.13.520253. https://doi.org/10.1101/2022.12.13.520253

Author

Marcelo Araya-Salas marcelo.araya@ucr.ac.cr)

Examples

{
  # load data and save example files into temporary working directory
  data("lbh1", "lbh2", "lbh_reference")
  tuneR::writeWave(lbh1, file.path(tempdir(), "lbh1.wav"))
  tuneR::writeWave(lbh2, file.path(tempdir(), "lbh2.wav"))

  # summary across sound files
  summarize_acoustic_data(path = tempdir())
}
#> Features of the acoustic data set in '/tmp/Rtmpc1ERJx':
#> 
#> * 14 sound files
#> 
#> * 2 file format(s) (.flac (2); .wav (12))
#> 
#> * 1 sampling rate(s) (22.05 kHz (14))
#> 
#> * 1 bit depth(s) (16 bits (14))
#> 
#> * 1 number of channels (1 channel(s) (14))
#> 
#> * File duration range: 1-5 s (mean: 2.14 s)
#> 
#> * File size range: 0.04-0.22 MB (mean: 0.09 MB)
#> 
#>  (detailed information by sound file can be obtained with 'warbleR::info_sound_files()')