Package icyllis.modernui.audio
Class SoundSample
java.lang.Object
icyllis.modernui.audio.SoundSample
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
VorbisPullDecoder
Sampled sound provides uncompressed PCM audio samples decoded from an
InputStream
or a FileChannel
.
This is the pulling API.-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected int
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
int
Get numbers of channels, either 1 or 2.int
abstract int
getSamplesShortInterleaved
(ShortBuffer pcmBuffer) float
Get the length of the sound in seconds.int
Get numbers of samples in one channel.abstract boolean
seek
(int sampleOffset)
-
Field Details
-
mSampleRate
protected int mSampleRate -
mChannels
protected int mChannels -
mTotalSamples
protected int mTotalSamples
-
-
Constructor Details
-
SoundSample
public SoundSample()
-
-
Method Details
-
getSampleRate
public int getSampleRate() -
getChannels
public int getChannels()Get numbers of channels, either 1 or 2.- Returns:
- numbers of channels
-
getTotalSamples
public int getTotalSamples()Get numbers of samples in one channel.- Returns:
- total samples
-
getTotalLength
public float getTotalLength()Get the length of the sound in seconds.- Returns:
- total length
-
seek
public abstract boolean seek(int sampleOffset) - Returns:
- success or not
-
getSamplesShortInterleaved
- Returns:
- samples per channel
-
close
public abstract void close()- Specified by:
close
in interfaceAutoCloseable
-