Learn R Programming

soundecology (version 1.3.3)

sound_raster: ASCII raster from sound file

Description

This function creates a raster file in ASCII format from the spectrogram of a soundfile. This file can be opened in ArcGIS or any other GIS software. For more details see the tutorial of Villanueva-Rivera et al. 2011.

Usage

sound_raster(wavfile = NA, wav_directory = NA, max_freq = 10000, no_cores = 1)

Arguments

wavfile

a single sound file in wav format.

max_freq

maximum frequency to draw the spectrogram, in Hertz.

wav_directory

a directory that contains wav files. To specify the working directory, use wav_directory="."

no_cores

number of cores to use when working in a directory. Can be max to use all cores, -1 to use all but one core, or any positive integer. Default is 1. Uses the parallel package.

Value

The function will save a file for each channel, in the same directory where the files are at, with the extension .asc.

References

Villanueva-Rivera, L. J., B. C. Pijanowski, J. Doucette, and B. Pekin. 2011. A primer of acoustic analysis for landscape ecologists. Landscape Ecology 26: 1233-1246. doi: 10.1007/s10980-011-9636-9.

Examples

Run this code
# NOT RUN {
sound_raster(wavfile = "file1.wav")

sound_raster(wav_directory = "/home/user/wavdirectory")

sound_raster(wav_directory = "/home/user/wavdirectory", no_cores = 4)
	
# }
# NOT RUN {
	
# }

Run the code above in your browser using DataLab