soundSample: Sound sample constructor.

View source: R/class_soundSample.R

soundSampleR Documentation

Sound sample constructor.

Description

Creates a new instance of a 'soundSample' object. A sound sample can be viewed as a minimalistic version of an "audio wave" object (see package tuneR for instance). It is necessarily mono and the wave time series is normalized between -1 and 1.

Usage

soundSample(wave, rate = 44100)

Arguments

wave

Numeric vector, wave time series

rate

Numeric, sampling rate (default 44100 Hz)

Value

An object of class 'soundSample'.

Examples

sam <- soundSample(sin(2*pi*seq(0,1,,44100)*440)) # 1-second A (440 Hz)
sam <- soundSample(sin(2*pi*seq(0,1,,44100)*440)+0.1*rnorm(44100)) # 1-second noisy A

benRenard/sequenceR documentation built on Jan. 11, 2025, 2:33 a.m.