Skip to contents

Wrapper for 'soundecology' package to calculate acoustic complexity, the bioacoustic index, and acoustic diversity. See Value for details about these indices.

Usage

acoustic_indices(
  path,
  min_freq = NA,
  max_freq = NA,
  units = "samples",
  quiet = FALSE
)

Arguments

path

Character. Path to wave file.

min_freq

Numeric. Minimum frequency for acoustic complexity (see soundecology::acoustic_complexity())

max_freq

Numeric. Maximum frequency for acoustic complexity (see soundecology::acoustic_complexity())

units

Character. Wave file units for reading the file. Defaults to "samples" (see tuneR::readWave()).

quiet

Logical. Whether to suppress progress messages and other non-essential updates.

Value

Returns a data frame with acoustic indices. Those prefaced with

Examples

w <- tuneR::sine(440, duration = 300000) # > 5s
tuneR::writeWave(w, "test_wave.wav")
acoustic_indices("test_wave.wav")
#> Calculating acoustic indices for test_wave.wav
#> 
#>  max_freq not set, using value of: 22050 
#> 
#> 
#>  min_freq not set, using value of: 0 
#> 
#> 
#>  This is a mono file.
#> 
#>  Calculating index. Please wait... 
#> 
#>   Acoustic Complexity Index (total): 134.1618
#> 
#> 
#>  This is a mono file.
#> 
#>  Calculating index. Please wait... 
#> 
#>   Bioacoustic Index: 10.97814
#> 
#> 
#>  This is a mono file.
#> 
#>  Calculating index. Please wait... 
#> 
#>   Acoustic Diversity Index: 0
#> # A tibble: 10 × 13
#>    file      complx_AciTotAll_left complx_AciTotAll_right complx_AciTotAll_lef…¹
#>    <chr>                     <dbl> <lgl>                                   <dbl>
#>  1 test_wav…                  134. NA                                      1183.
#>  2 test_wav…                  134. NA                                      1183.
#>  3 test_wav…                  134. NA                                      1183.
#>  4 test_wav…                  134. NA                                      1183.
#>  5 test_wav…                  134. NA                                      1183.
#>  6 test_wav…                  134. NA                                      1183.
#>  7 test_wav…                  134. NA                                      1183.
#>  8 test_wav…                  134. NA                                      1183.
#>  9 test_wav…                  134. NA                                      1183.
#> 10 test_wav…                  134. NA                                      1183.
#> # ℹ abbreviated name: ¹​complx_AciTotAll_left_bymin
#> # ℹ 9 more variables: complx_AciTotAll_right_bymin <lgl>, bio_left_area <dbl>,
#> #   bio_right_area <lgl>, div_adi_left <dbl>, div_adi_right <lgl>,
#> #   div_left_band_values <dbl>, div_right_band_values <lgl>,
#> #   div_left_bandrange_values <chr>, div_right_bandrange_values <lgl>
acoustic_indices("test_wave.wav", quiet = TRUE)
#> # A tibble: 10 × 13
#>    file      complx_AciTotAll_left complx_AciTotAll_right complx_AciTotAll_lef…¹
#>    <chr>                     <dbl> <lgl>                                   <dbl>
#>  1 test_wav…                  134. NA                                      1183.
#>  2 test_wav…                  134. NA                                      1183.
#>  3 test_wav…                  134. NA                                      1183.
#>  4 test_wav…                  134. NA                                      1183.
#>  5 test_wav…                  134. NA                                      1183.
#>  6 test_wav…                  134. NA                                      1183.
#>  7 test_wav…                  134. NA                                      1183.
#>  8 test_wav…                  134. NA                                      1183.
#>  9 test_wav…                  134. NA                                      1183.
#> 10 test_wav…                  134. NA                                      1183.
#> # ℹ abbreviated name: ¹​complx_AciTotAll_left_bymin
#> # ℹ 9 more variables: complx_AciTotAll_right_bymin <lgl>, bio_left_area <dbl>,
#> #   bio_right_area <lgl>, div_adi_left <dbl>, div_adi_right <lgl>,
#> #   div_left_band_values <dbl>, div_right_band_values <lgl>,
#> #   div_left_bandrange_values <chr>, div_right_bandrange_values <lgl>
unlink("test_wave.wav")