Learn R Programming

seewave (version 2.1.6)

songmeter: Reading and interpreting SongMeter file name

Description

This function reads and decomposes the files names generated by a SongMeter device, audio digal recorders produced by the society Wildlife Acoustics.

Usage

songmeter(x)

Arguments

x

a character vector with file names, either .wac or .wav

Value

The function returns a data.frame with the following columns:

model

device model, either "SM2/SM4" or "SM3"

prefix

prefix of the file, specifying for instance to recording site

mic

microphone information specifying if the recording is mono left channel ("monoL"), mono right ("monoR") or stereo ("stereo"). This works for SM3 only, NA for SM2

year

year of recording, numeric

month

month of recording, numeric

day

day of recording, numeric

hour

hour of recording, numeric

min

minute of recording, numeric

sec

second of recording, numeric

time

time in POSIX format

geo

logical, TRUE if the device was GPS synchronized

Details

The digital recorder SongMeter (either SM2, SM3, or SM4 device model) produced by the society 'Wildlife Acoustics' (https://www.wildlifeacoustics.com/) generates '.wav' files which names include useful information. Here are the character format of the files:

  • SM2 or SM4: PREFIX_YYYYMMDD_HHMMSS.wav

  • SM3:

    • without geolocalisation PREFIX_XXX_YYYYMMDD_HHMMSS.wav

    • with geolocalisation PREFIX_XXX_YYYYMMDD$HHMMSS.wav

with:

  • PREFIX: prefix set when programming the SongMeter

  • XXX: microphone information

  • YYYY: year

  • MM: month

  • DD: day

  • HH: hour

  • MM: month

  • SS: minute

This information is read and decomposed by the function songmeter(). Please note that the function does not read the content of audio file but the name of the file.

References

See Wildlife Acoustics website for details regarding the SongMeters 2, 3 and 4: http://www.wildlifeacoustics.com/

See Also

songmeterdiag, audiomoth, strptime for the POSIX time format.

Examples

Run this code
# NOT RUN {
file1 <- "MNHN_20141225_234500.wav"      # SM2 file
file2 <- "CNRS_0+1_20130824_153000.wav"  # SM3 file without geolocalisation
file3 <- "PARIS_-0-_20150410$195550.wav" # SM3 file with geolocalisation
file4 <- "MNHN_20141225_234500.txt"      # not a .wav or a .wac file
file5 <- "myfile.wav"                    # not a Wildlife Acoustics filename
files <- c(file1, file2, file3, file4, file5)
songmeter(files)
# }

Run the code above in your browser using DataLab