Learn R Programming

ProTrackR (version 0.4.4)

sampleLength: Get the length of a PTSample

Description

Gets the length (in samples = bytes) of an audio fragment stored as a PTSample.

Usage

# S4 method for PTSample
sampleLength(sample)

Value

Returns a numeric value representing the number of samples (bytes) the PTSample object sample is composed of.

Arguments

sample

A PTSample object for which the length needs to be returned.

Author

Pepijn de Vries

Details

PTSamples are 8 bit mono audio fragments. This method returns the length of this fragment expressed as number of samples (which also equals the number of bytes).

See Also

Other sample.operations: PTSample-class, PTSample-method, fineTune(), loopLength(), loopSample(), loopStart(), loopState(), name, playSample(), read.sample(), volume(), waveform(), write.sample()

Examples

Run this code
data("mod.intro")

## Show the length of the second sample in mod.intro
sampleLength(PTSample(mod.intro, 2))

Run the code above in your browser using DataLab