Package icyllis.modernui.audio
Class SoundStream
java.lang.Object
icyllis.modernui.audio.SoundStream
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
VorbisPushDecoder
Sound stream provides uncompressed PCM audio samples decoded from an
InputStream or a FileChannel.
This is the pushing API, no seeking.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()abstract FloatBufferdecodeFrame(FloatBuffer output) static shortf_to_s16(float s) intGet numbers of channels, either 1 or 2.intGet sample offset of the start of next frame.intstatic floats16_to_f(short s)
-
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
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
f_to_s16
public static short f_to_s16(float s) -
s16_to_f
public static float s16_to_f(short s)
-