Package icyllis.modernui.audio

# Class SoundStream

java.lang.Object
icyllis.modernui.audio.SoundStream

All Implemented Interfaces:
  `AutoCloseable`

Direct Known Subclasses:
  `VorbisPushDecoder`

public abstract class SoundStream extends Object implements AutoCloseable
Sound stream provides uncompressed PCM audio samples decoded from an `InputStream` or a `FileChannel`. This is the pushing API, no seeking.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `mChannels`
  `protected int`
  `mSampleOffset`
  `protected int`
  `mSampleRate`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SoundStream()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract void`
  `close()`
  `abstract FloatBuffer`
  `decodeFrame(FloatBuffer output)`
  `static short`
  `f_to_s16(float s)`
  `int`
  `getChannels()`
  Get numbers of channels, either 1 or 2.
  `int`
  `getSampleOffset()`
  Get sample offset of the start of next frame.
  `int`
  `getSampleRate()`
  `static float`
  `s16_to_f(short s)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### mSampleRate

    protected int mSampleRate

  - ### mChannels

    protected int mChannels

  - ### mSampleOffset

    protected int mSampleOffset

- ## Constructor Details

  - ### SoundStream

    public SoundStream()

- ## Method Details

  - ### getSampleRate

    public int getSampleRate()

  - ### getChannels

    public int getChannels()
    Get numbers of channels, either 1 or 2.
    Returns:
      numbers of channels

  - ### getSampleOffset

    public int getSampleOffset()
    Get sample offset of the start of next frame.
    Returns:
      offset in samples

  - ### decodeFrame

    @Nullable public abstract FloatBuffer decodeFrame(@Nullable FloatBuffer output) throws IOException
    Throws:
      `IOException`

  - ### close

    public abstract void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Throws:
      `IOException`

  - ### f_to_s16

    public static short f_to_s16(float s)

  - ### s16_to_f

    public static float s16_to_f(short s)