AudioStream

An AudioStream is a pointer to a dynamically allocated Stream.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

cleanUp
void cleanUp()
Undocumented in source. Be warned that the author may not have intended to support it.
finalizeAndGetEncodedResult
const(ubyte)[] finalizeAndGetEncodedResult()
Undocumented in source. Be warned that the author may not have intended to support it.
finalizeEncoding
void finalizeEncoding()

Finalize encoding. After finalization, further writes are not possible anymore however the stream is considered complete and valid for storage.

flush
void flush()

Call fflush() on written samples, if any. It is only useful for streamable output formats, that may want to flush things to disk.

getFormat
AudioFileFormat getFormat()
getLengthInFrames
long getLengthInFrames()
getNumChannels
int getNumChannels()
getSamplerate
float getSamplerate()
openFromFile
void openFromFile(const(char)[] path)

Opens an audio stream that decodes from a file. This stream will be opened for reading only.

openFromMemory
void openFromMemory(const(ubyte)[] inputData)

Opens an audio stream that decodes from memory. This stream will be opened for reading only. Note: throws a manually allocated exception in case of error. Free it with dplug.core.destroyFree.

openToBuffer
void openToBuffer(AudioFileFormat format, float sampleRate, int numChannels)

Opens an audio stream that writes to a dynamically growable output buffer. This stream will be opened for writing only. Access to the internal buffer after encoding with finalizeAndGetEncodedResult. Note: throws a manually allocated exception in case of error. Free it with dplug.core.destroyFree.

openToFile
void openToFile(const(char)[] path, AudioFileFormat format, float sampleRate, int numChannels)

Opens an audio stream that writes to file. This stream will be opened for writing only. Note: throws a manually allocated exception in case of error. Free it with dplug.core.destroyFree.

openToMemory
void openToMemory(ubyte* data, size_t maxLength, AudioFileFormat format, float sampleRate, int numChannels)

Opens an audio stream that writes to a pre-defined area in memory of maxLength bytes. This stream will be opened for writing only. Destroy this stream with closeAudioStream. Note: throws a manually allocated exception in case of error. Free it with dplug.core.destroyFree.

readSamplesFloat
int readSamplesFloat(float* outData, int frames)
int readSamplesFloat(float[] outData)

Read interleaved float samples in the given buffer outData.

realtimeSafe
bool realtimeSafe()
writeSamplesFloat
int writeSamplesFloat(float* inData, int frames)
int writeSamplesFloat(float[] inData)

Write interleaved float samples to the stream, from the given buffer inData[0..frames].

Meta