Internal
Creates an instance of FrameBufferSegment. This constructor is intended for internal use only, and instances are generated by the library.
The shared Float32Array buffer containing audio samples.
The number of channels per frame.
The starting frame index within the buffer.
The number of frames included in this segment.
Readonly
channelsThe number of channels in each frame. This value defines how many samples make up a single frame.
Readonly
frameThe number of frames in this segment. This determines the length of this segment in terms of frames, rather than samples.
Readonly
samplesThe Float32Array representing the sample data in the segment. Each frame consists of multiple samples (one for each channel).
If the arrangement of samples within a frame is understood, direct access to samples
is possible without using the get
and set
methods, by indexing based on
frame * channels + channel
.
Gets the sample value for a specific frame and channel.
The frame index within the segment (0 to frameCount - 1).
The channel index within the frame (0 to channels - 1).
The sample value for the specified frame and channel.
Sets the sample value for a specific frame and channel.
The frame index within the segment (0 to frameCount - 1).
The channel index within the frame (0 to channels - 1).
The value to set for the specified frame and channel.
FrameBufferSegment class Represents a segment of audio frames within a shared Float32Array buffer, providing methods to access and modify individual samples in a frame-based structure across multiple channels.
This class is used internally by the library to represent a specific range of frames within the shared buffer, allowing controlled access for reading or writing operations. Users do not create instances of this class directly; instead, instances are provided by the library when using the FrameBufferReader.read and FrameBufferWriter.write methods.