Interface PAFloatSource

All Known Subinterfaces:
PASource
All Known Implementing Classes:
BasicIndexGranularSource, IndexGranularSource, MCBufferSource, PABufferBackedSource, PABurstGranularSource, PathGranularSource

public interface PAFloatSource
PAFloatSource Minimal, library-agnostic "audio source" abstraction for PixelAudio voices. It deals only with float[] buffers and sample indices, no Minim types. Implementations are expected to: - be called on the audio thread, - be allocation-free inside renderBlock().
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Duration in samples, or Long.MAX_VALUE if effectively infinite/streaming.
    void
    renderBlock(long blockStart, int blockSize, float[] outL, float[] outR)
    Render audio into the given block buffers.
  • Method Details

    • renderBlock

      void renderBlock(long blockStart, int blockSize, float[] outL, float[] outR)
      Render audio into the given block buffers. Implementations should: - Assume outL/outR length >= blockSize. - Mix into outL/outR (add), not clear them. - Avoid allocation on the audio thread.
      Parameters:
      blockStart - the absolute sample index in the source’s own sample domain (e.g., buffer index space).
      blockSize - number of samples in this block.
      outL - left channel buffer to mix into.
      outR - right channel buffer to mix into (may be same as outL for mono).
    • lengthSamples

      long lengthSamples()
      Duration in samples, or Long.MAX_VALUE if effectively infinite/streaming.