fastReadWave: Load Wave File

View source: R/fastReadWave.R

fastReadWaveR Documentation

Load Wave File

Description

loads data from a WAVE file

Usage

fastReadWave(where, from = 0, to = NA_real_, header = FALSE, toWaveMC = FALSE)

Arguments

where

file to load data from

from

starting point to load data from (seconds)

to

end point to read data to (seconds), NA to read til end

header

logical flag to read only header information

toWaveMC

logical flag to return a WaveMC object

Details

WAVE is a RIFF (Resource Interchange File Format) widely used for storage of uncompressed audio data. It is often identified by the extension .WAV on DOS-legacy systems (such as Windows). Although WAVE files may contain compressed data, the above functions only support plain, uncompressed PCM data.

This function was originally written Simon Urbanek, all credit for the bulk of the C programming goes to him. Adapted by Taiki Sakai to add additional features and fix some bugs. See additional license comments in file.c

Value

returns an object of the class audioSample as loaded from the WAVE file, or if header=TRUE a named list with the sample.rate, num channels, bit rate, and sample length. audioSample objects store the wav data as a matrix wth one row for every channel and attributes "rate" and "bits"

Author(s)

Taiki Sakai taiki.sakai@noaa.gov


TaikiSan21/PAMmisc documentation built on Oct. 15, 2024, 9:29 p.m.