Class Alsa.Tuner

java.lang.Object
net.avadeaux.klipspringer.alsa.Alsa
net.avadeaux.klipspringer.alsa.Alsa.Tuner
All Implemented Interfaces:
Closeable, AutoCloseable, Device.Tuner, PcmReader
Enclosing class:
Alsa

public static class Alsa.Tuner extends Alsa implements Device.Tuner
Class for receiving PCM data from an ALSA device.
  • Field Details

    • devices

      public static final Map<String,Device> devices
      Map from available input device names to the device objects.
  • Constructor Details

    • Tuner

      public Tuner(Device device, PcmFormat format, double bufferSecs, int recoveryAttempts) throws IOException
      Creates a tuner to input PCM from the given device in the given format, specifying the size of the external buffer, and the number of recovery attempts in case of buffer overrun. Available devices are obtained through devices. A reasonable number of recovery attempts is 2 if you want to continue receiving after a stutter in the input, or 0 if you want to get an exception as soon as an overrun happens.
      Throws:
      IOException
  • Method Details

    • read

      public boolean read(ByteBuffer dest) throws IOException
      Description copied from interface: PcmReader
      Reads frames until buffer is full, input is exhausted, or the source is closed. Returns false if input is exhausted, true if the source may provide more data.
      Specified by:
      read in interface PcmReader
      Throws:
      IOException