Sound

The simple structure currently used in wave-d. Expect changes about this.

Constructors

this
this(int sampleRate, int channels, float[] samples)

Build with interleaved data.

this
this(int sampleRate, float[][] planarSamples)

Build with channel data. Interleave them. channels must have the same length.

Members

Aliases

data
deprecated alias data = samples
Undocumented in source.
numChannels
deprecated alias numChannels = channels
Undocumented in source.

Functions

channel
float[] channel(int chan)

Allocates a new array and put deinterleaved channel samples inside.

lengthInFrames
int lengthInFrames()
lengthInSeconds
double lengthInSeconds()
makeMono
Sound makeMono()
sample
inout(float) sample(int chan, int frame)

Direct sample access.

Variables

channels
int channels;

Number of interleaved channels in data.

sampleRate
int sampleRate;

Sample rate.

samples
float[] samples;

data layout: machine endianness, interleaved channels. Contains numChannels * lengthInFrames() samples.

Meta