Interface AudioOutputPeer


public interface AudioOutputPeer
A platform audio output stream that pulls samples from an AudioRenderCallback. Ports implement this and return it from CodenameOneImplementation.openAudioOutput; applications use AudioContext instead.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Stops the stream for good and releases the device.
    int
    The number of interleaved channels passed to the render callback.
    double
    The time between a sample being rendered and it being heard, as well as the port can tell.
    int
    The sample rate the device actually runs at, which may differ from the one requested.
    void
    Starts, or resumes, calling the render callback.
    void
    Pauses the stream; the render callback is not called until start().
  • Method Details

    • start

      void start()
      Starts, or resumes, calling the render callback.
    • stop

      void stop()
      Pauses the stream; the render callback is not called until start().
    • close

      void close()
      Stops the stream for good and releases the device.
    • getSampleRate

      int getSampleRate()

      The sample rate the device actually runs at, which may differ from the one requested.

      Returns

      frames per second

    • getChannels

      int getChannels()

      The number of interleaved channels passed to the render callback.

      Returns

      the channel count

    • getOutputLatency

      double getOutputLatency()

      The time between a sample being rendered and it being heard, as well as the port can tell.

      Returns

      the latency in seconds, or 0 when unknown