In [1]:
library('tuneR')
library('seewave')
library('soundecology')


tuneR >= 1.0 has changed its Wave class definition.
Use updateWave(object) to convert Wave objects saved with previous versions of tuneR.

In [2]:
exists("sound")


Out[2]:
FALSE

In [2]:
sound <- readWave("/Users/Jake/Desktop/test/160224-160000.wav")

In [4]:
exists("sound")


Out[4]:
TRUE

In [5]:
remove("sound")

In [6]:
exists("sound")


Out[6]:
FALSE

In [ ]:


In [13]:
if (!(exists("sound"))) { sound <- readWave("/Users/Jake/Desktop/test/160224-160000.wav") }

In [3]:
results <- acoustic_evenness(sound, max_freq = 12000, db_threshold = -50, freq_step = 1000)


 This is a stereo file. Results will be given for each channel.

 Calculating index. Please wait... 

  Acoustic Evenness Index: 
   Left channel: 0.882366
   Right channel: 0.901454


In [7]:
results$aei_left


Out[7]:
0.882366

In [9]:
results <- acoustic_complexity(sound, min_freq = NA, max_freq = NA, j = 5, fft_w = 512)


 This is a stereo file. Results will be given for each channel.

 Calculating index. Please wait... 

  Acoustic Complexity Index (total):
   Left channel: 9065.062
   Right channel: 9102.704

  Acoustic Complexity Index (by minute):
   Left channel: 1813.01
   Right channel: 1820.54


In [11]:
results$AciTotAll_right_bymin


Out[11]:
1820.54

In [12]:
results <- bioacoustic_index(sound, min_freq = 2000, max_freq = 8000, fft_w = 512)


 This is a stereo file. Results will be given for each channel.

 Calculating index. Please wait... 

  Bioacoustic Index:
   Left channel: 2.63835
   Right channel: 2.795034


In [13]:
results


Out[13]:
$left_area
2.63835006880207
$right_area
2.79503423071546

In [14]:
results$left_area


Out[14]:
2.63835006880207

In [15]:
results <- ndsi(sound, fft_w = 1024, anthro_min = 1000, anthro_max = 2000, bio_min = 2000, bio_max = 11000)


 This is a stereo file. Results will be given for each channel.

 Calculating index. Please wait... 
  Normalized Difference Soundscape Index:

   Left channel: -0.1990155
   Right channel: 0.2760062


In [16]:
results


Out[16]:
$ndsi_left
-0.199015541366663
$ndsi_right
0.276006244844203
$biophony_left
0.636516954166332
$anthrophony_left
0.952819636090052
$biophony_right
1.31296417300692
$anthrophony_right
0.744963330580227

In [17]:
results$biophony_left


Out[17]:
0.636516954166332

In [4]:
results <- soundscapespec(sound, wl = 1024, wn = "hamming", ovlp = 50, plot = TRUE, xlab = "Frequency (kHz)", ylim = c(0, 1))



In [3]:
results <- soundscapespec(sound, wl = 1024, wn = "hamming", ovlp = 50, plot = FALSE)

In [6]:
results


Out[6]:
frequencyamplitude
1.00000000.9498521
2.00000000.2728844
3.000000000.08939891
4.000000000.06035364
5.000000000.04804869
6.000000000.03802297
7.000000000.03001304
8.000000000.02974266
9.000000000.02919346
10.00000000 0.02934304
11.00000000 0.02617188
12.00000000 0.02898327
13.00000000 0.02191298
14.00000000 0.01868814
15.00000000 0.01827568
16.00000000 0.01762753
17.00000000 0.01675185
18.00000000 0.01696118
19.00000000 0.01564436
20.00000000 0.01527144
21.00000000 0.01568645
22.00000000 0.01161426
2.300000e+019.173921e-04