SamplingRateAccessor
, SoundSample
, org.refcodes.mixin.IndexAccessor
, org.refcodes.mixin.TimeStampAccessor
MonoSampleImpl
public class SoundSampleImpl extends Object implements SoundSample
SoundSample
represents multiple amplitudes (one for each
channel,e.g. two in case we have classical stereo sound) assigned to an
according time positioning.org.refcodes.mixin.IndexAccessor.IndexBuilder<B extends org.refcodes.mixin.IndexAccessor.IndexBuilder<B>>, org.refcodes.mixin.IndexAccessor.IndexMutator, org.refcodes.mixin.IndexAccessor.IndexProperty
SamplingRateAccessor.SamplingRateBuilder<B extends SamplingRateAccessor.SamplingRateBuilder<B>>, SamplingRateAccessor.SamplingRateMutator, SamplingRateAccessor.SamplingRateProperty
org.refcodes.mixin.TimeStampAccessor.TimeStampBuilder<B extends org.refcodes.mixin.TimeStampAccessor.TimeStampBuilder<B>>, org.refcodes.mixin.TimeStampAccessor.TimeStampMutator, org.refcodes.mixin.TimeStampAccessor.TimeStampProperty
Constructor | Description |
---|---|
SoundSampleImpl(double[] aSample) |
Constructs a
SoundSample instance with the according time and
sample settings. |
SoundSampleImpl(double[] aSample,
int aSamplingRate) |
Constructs a
SoundSample instance with the according time and
sample settings. |
SoundSampleImpl(double aTimeMillis,
double[] aSample) |
Constructs a
SoundSample instance with the according time and
sample settings. |
SoundSampleImpl(double aTimeMillis,
double[] aSample,
int aSamplingRate) |
Constructs a
SoundSample instance with the according time and
sample settings. |
SoundSampleImpl(long aIndex,
double[] aSample) |
Constructs a
SoundSample instance with the according time and
sample settings. |
SoundSampleImpl(long aIndex,
double[] aSample,
int aSamplingRate) |
Constructs a
SoundSample instance with the according time and
sample settings. |
SoundSampleImpl(long aIndex,
double aTimeMillis,
double[] aSample) |
Constructs a
SoundSample instance with the according time and
sample settings. |
SoundSampleImpl(long aIndex,
double aTimeMillis,
double[] aSample,
int aSamplingRate) |
Constructs a
SoundSample instance with the according time and
sample settings. |
SoundSampleImpl(SoundSample aSample) |
Constructs a
SoundSample instance with the according sound
sample's settings |
Modifier and Type | Method | Description |
---|---|---|
long |
getIndex() |
|
double[] |
getSampleData() |
Returns the sample's data for the according time positioning.
|
int |
getSamplingRate() |
Retrieves the sampling rate from the sampling rate property.
|
double |
getTimeStamp() |
Returns the position in time of this sound sample in ms.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChannelCount
public SoundSampleImpl(SoundSample aSample)
SoundSample
instance with the according sound
sample's settingsaSample
- The sample (set of values representing the channels, one
channel per value) for the related time positioning.public SoundSampleImpl(double[] aSample)
SoundSample
instance with the according time and
sample settings.aSample
- The sample (set of values representing the channels, one
channel per value) for the related time positioning.public SoundSampleImpl(double aTimeMillis, double[] aSample)
SoundSample
instance with the according time and
sample settings.aTimeMillis
- The time positioning of this sound sample.aSample
- The sample (set of values representing the channels, one
channel per value) for the related time positioning.public SoundSampleImpl(double aTimeMillis, double[] aSample, int aSamplingRate)
SoundSample
instance with the according time and
sample settings.aTimeMillis
- The time positioning of this sound sample.aSample
- The sample (set of values representing the channels, one
channel per value) for the related time positioning.aSamplingRate
- The sampling rate for the given sample.public SoundSampleImpl(double[] aSample, int aSamplingRate)
SoundSample
instance with the according time and
sample settings.aSample
- The sample (set of values representing the channels, one
channel per value) for the related time positioning.aSamplingRate
- The sampling rate for the given sample.public SoundSampleImpl(long aIndex, double[] aSample)
SoundSample
instance with the according time and
sample settings.aIndex
- The index of the sample according to its position in the
sample sequence (e.g. sound file).aSample
- The sample (set of values representing the channels, one
channel per value) for the related time positioning.public SoundSampleImpl(long aIndex, double[] aSample, int aSamplingRate)
SoundSample
instance with the according time and
sample settings.aIndex
- The index of the sample according to its position in the
sample sequence (e.g. sound file).aSample
- The sample (set of values representing the channels, one
channel per value) for the related time positioning.aSamplingRate
- The sampling rate for the given sample.public SoundSampleImpl(long aIndex, double aTimeMillis, double[] aSample)
SoundSample
instance with the according time and
sample settings.aIndex
- The index of the sample according to its position in the
sample sequence (e.g. sound file).aTimeMillis
- The time positioning of this sound sample.aSample
- The sample (set of values representing the channels, one
channel per value) for the related time positioning.public SoundSampleImpl(long aIndex, double aTimeMillis, double[] aSample, int aSamplingRate)
SoundSample
instance with the according time and
sample settings.aIndex
- The index of the sample according to its position in the
sample sequence (e.g. sound file).aTimeMillis
- The time positioning of this sound sample.aSample
- The sample (set of values representing the channels, one
channel per value) for the related time positioning.aSamplingRate
- The sampling rate for the given sample.public double[] getSampleData()
getSampleData
in interface SoundSample
public double getTimeStamp()
getTimeStamp
in interface SoundSample
getTimeStamp
in interface org.refcodes.mixin.TimeStampAccessor
public int getSamplingRate()
getSamplingRate
in interface SamplingRateAccessor
public long getIndex()
getIndex
in interface org.refcodes.mixin.IndexAccessor
Copyright © 2021. All rights reserved.