SoundBuffer

Storage for audio samples defining a sound.

Constructors

this
this()

Default constructor.

Destructor

~this
~this()

Destructor.

Members

Functions

getChannelCount
uint getChannelCount()

Get the number of channels used by the sound.

getDuration
Duration getDuration()

Get the total duration of the sound.

getSampleRate
uint getSampleRate()

Get the sample rate of the sound.

getSamples
const(short[]) getSamples()

Get the array of audio samples stored in the buffer.

loadFromFile
bool loadFromFile(const(char)[] filename)

Load the sound buffer from a file.

loadFromMemory
bool loadFromMemory(const(void)[] data)

Load the sound buffer from a file in memory.

loadFromSamples
bool loadFromSamples(const(short[]) samples, uint channelCount, uint sampleRate)

Load the sound buffer from an array of audio samples.

saveToFile
bool saveToFile(const(char)[] filename)

Save the sound buffer to an audio file.

Meta