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
Modifier and TypeFieldDescriptionprotected int
protected int
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
abstract FloatBuffer
decodeFrame
(FloatBuffer output) static short
f_to_s16
(float s) int
Get numbers of channels, either 1 or 2.int
Get sample offset of the start of next frame.int
static float
s16_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:
close
in 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)
-