Struct libaudioverse::buffer::Buffer [] [src]

pub struct Buffer { /* fields omitted */ }

Buffers store un-encoded float32 audio data at the sampling rate of the server. They can be loaded from files or arrays, and will resample the data exactly once when loaded. Buffers are most commonly used with buffer nodes. Save for the contained audio data, buffers are stateless; using them requires coupling them with a node. Since buffers are quite large, using a cache is recommended. Buffers may safely be used in more than one place at a time. Modifying a buffer’s audio data while it is in use will result in an error.

Methods

impl Buffer
[src]

[src]

Creates a new audio buffer.

[src]

Get the duration of the buffer in seconds.

[src]

Get the length of the specified buffer in samples. The sample rate of a buffer is the sample rate of the server for which that buffer was created. This function is primarily useful for estimating ram usage in caching structures.

[src]

Takes an encoded array of audio data and decodes it.

[src]

Load from an array of interleaved floats.

[src]

Loads data into this buffer from a file. The file will be resampled to the sampling rate of the server. This will happen synchronously.

[src]

Normalizes the buffer.