S
- The SoundSample
(sub-)type on which the
SampleWriter
implementation is to operate on.B
- The SampleWriter
implementing this
AbstractLineOutSampleWriter
.AutoCloseable
, BitsPerSampleAccessor
, BitsPerSampleAccessor.BitsPerSampleBuilder<S>
, BitsPerSampleAccessor.BitsPerSampleMutator
, BitsPerSampleAccessor.BitsPerSampleProperty
, LineOutSampleWriter<S,B>
, SampleWriter<S,B>
, SamplingRateAccessor
, SamplingRateAccessor.SamplingRateBuilder<S>
, SamplingRateAccessor.SamplingRateMutator
, SamplingRateAccessor.SamplingRateProperty
, org.refcodes.io.RowWriter<S>
LineOutMonoSampleWriter
, LineOutSoundSampleWriter
public abstract class AbstractLineOutSampleWriter<S extends SoundSample,B extends LineOutSampleWriter<S,B>> extends Object implements LineOutSampleWriter<S,B>
AbstractLineOutSampleWriter
provides a foundation means to write
sound samples to a line-out device.BitsPerSampleAccessor.BitsPerSampleBuilder<B extends BitsPerSampleAccessor.BitsPerSampleBuilder<B>>, BitsPerSampleAccessor.BitsPerSampleMutator, BitsPerSampleAccessor.BitsPerSampleProperty
SamplingRateAccessor.SamplingRateBuilder<B extends SamplingRateAccessor.SamplingRateBuilder<B>>, SamplingRateAccessor.SamplingRateMutator, SamplingRateAccessor.SamplingRateProperty
Modifier and Type | Field | Description |
---|---|---|
protected BitsPerSample |
_bitsPerSample |
|
protected static long |
MAX_16_BIT |
|
protected static long |
MAX_8_BIT |
Constructor | Description |
---|---|
AbstractLineOutSampleWriter() |
Constructs an
AbstractLineOutSampleWriter . |
AbstractLineOutSampleWriter(BitsPerSample aBitsPerSample) |
Constructs an
AbstractLineOutSampleWriter with the given
BitsPerSample to use. |
Modifier and Type | Method | Description |
---|---|---|
BitsPerSample |
getBitsPerSample() |
Retrieves the bits/sample per channel from the bits/sample per channel
property.
|
void |
setBitsPerSample(BitsPerSample aBitsPerSample) |
Sets the bits/sample per channel for the bits/sample per channel
property.
|
protected static SourceDataLine |
toLineOut(SoundSample aSoundSample,
BitsPerSample aBitsPerSample) |
Produces a line-out
SourceDataLine instance for writing samples
to. |
protected long |
toWavSample(double eSampleData) |
withBitsPerSample
letBitsPerSample
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, writeNext
getSamplingRate
withSamplingRate
setSamplingRate
letSamplingRate
protected static final long MAX_16_BIT
protected static final long MAX_8_BIT
protected BitsPerSample _bitsPerSample
public AbstractLineOutSampleWriter()
AbstractLineOutSampleWriter
.public AbstractLineOutSampleWriter(BitsPerSample aBitsPerSample)
AbstractLineOutSampleWriter
with the given
BitsPerSample
to use.aBitsPerSample
- The bits/sample to use when doing audio playback.public void setBitsPerSample(BitsPerSample aBitsPerSample)
setBitsPerSample
in interface BitsPerSampleAccessor.BitsPerSampleMutator
aBitsPerSample
- The bits/sample per channel to be stored by the
sampling rate property.public BitsPerSample getBitsPerSample()
getBitsPerSample
in interface BitsPerSampleAccessor
protected long toWavSample(double eSampleData)
protected static SourceDataLine toLineOut(SoundSample aSoundSample, BitsPerSample aBitsPerSample) throws LineUnavailableException
SourceDataLine
instance for writing samples
to.aSoundSample
- The SoundSample
from which to get the
according metrics.aBitsPerSample
- The preferred bits/sample.SourceDataLine
to which to write data.LineUnavailableException
- thrown in case the audio-line cannot be
acquired.Copyright © 2021. All rights reserved.