Interface PAFloatSource
- All Known Subinterfaces:
PASource
- All Known Implementing Classes:
PABurstGranularSource
public interface PAFloatSource
Minimal, library-agnostic audio source abstraction for PixelAudio voices.
PAFloatSource deals only with floating-point audio buffers and sample indices.
It deliberately avoids Minim and Processing types so sources can be rendered by PixelAudio's
voice classes without depending on a particular audio backend.
Implementations are expected to be safe for audio-thread use:
- mix into output buffers rather than clearing them;
- avoid allocation and blocking work in
renderBlock(long, int, float[], float[]); - treat
blockStartas an absolute sample position in the source's playback domain.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionlongReturns the source duration in samples.voidrenderBlock(long blockStart, int blockSize, float[] outL, float[] outR) Renders audio into the supplied block buffers.
-
Method Details
-
renderBlock
void renderBlock(long blockStart, int blockSize, float[] outL, float[] outR) Renders audio into the supplied block buffers.Implementations should assume that
outLandoutRhave at leastblockSizeelements. Samples should be added to the buffers, not assigned over existing contents, so multiple voices can accumulate into the same output block.- Parameters:
blockStart- absolute sample index in the source's playback domainblockSize- number of samples to renderoutL- left channel buffer to mix intooutR- right channel buffer to mix into; may be the same array asoutLfor mono
-
lengthSamples
long lengthSamples()Returns the source duration in samples.- Returns:
- duration in samples, or
Long.MAX_VALUEfor an effectively infinite or streaming source
-