AutoCloseable
, BitsPerSampleAccessor
, BitsPerSampleAccessor.BitsPerSampleBuilder<SoundSample>
, BitsPerSampleAccessor.BitsPerSampleMutator
, BitsPerSampleAccessor.BitsPerSampleProperty
, LineOutSampleWriter<SoundSample,LineOutSoundSampleWriter>
, SampleWriter<SoundSample,LineOutSoundSampleWriter>
, SamplingRateAccessor
, SamplingRateAccessor.SamplingRateBuilder<SoundSample>
, SamplingRateAccessor.SamplingRateMutator
, SamplingRateAccessor.SamplingRateProperty
, SoundSampleWriter<LineOutSoundSampleWriter>
, org.refcodes.io.RowWriter<SoundSample>
public class LineOutSoundSampleWriter extends AbstractLineOutSampleWriter<SoundSample,LineOutSoundSampleWriter> implements LineOutSampleWriter<SoundSample,LineOutSoundSampleWriter>, SoundSampleWriter<LineOutSoundSampleWriter>
LineOutSoundSampleWriter
provides 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
_bitsPerSample, MAX_16_BIT, MAX_8_BIT
Constructor | Description |
---|---|
LineOutSoundSampleWriter() |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
protected SourceDataLine |
getLineOut() |
Produces a line-out
SourceDataLine instance for writing samples
to. |
int |
getSamplingRate() |
Retrieves the sampling rate from the sampling rate property.
|
void |
setSamplingRate(int aSamplingRate) |
Sets the sampling rate for the sampling rate property.
|
LineOutSoundSampleWriter |
withBitsPerSample(BitsPerSample aBitsPerSample) |
Sets the bits/sample per channel for the bits/sample per channel
property.
|
LineOutSoundSampleWriter |
withSamplingRate(int aSamplingRate) |
Sets the sampling rate for the sampling rate property.
|
void |
writeNext(double... aSampleData) |
Writes the next samples, one sample for each channel.
|
void |
writeNext(SoundSample aSample) |
Writes the next samples, one sample for each channel.
|
getBitsPerSample, setBitsPerSample, toLineOut, toWavSample
getBitsPerSample
setBitsPerSample
letBitsPerSample
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
letSamplingRate
public LineOutSoundSampleWriter withBitsPerSample(BitsPerSample aBitsPerSample)
withBitsPerSample
in interface BitsPerSampleAccessor.BitsPerSampleBuilder<SoundSample>
aBitsPerSample
- The bits/sample per channel to be stored by the
sampling rate property.public void writeNext(double... aSampleData) throws IOException
writeNext
in interface SoundSampleWriter<LineOutSoundSampleWriter>
aSampleData
- The samples, one for each channel.IOException
- thrown in case writing the sample caused an I/O
related problem.public void writeNext(SoundSample aSample) throws IOException
writeNext
in interface org.refcodes.io.RowWriter<SoundSample>
writeNext
in interface SampleWriter<SoundSample,LineOutSoundSampleWriter>
writeNext
in interface SoundSampleWriter<LineOutSoundSampleWriter>
aSample
- The samples, one for each channel.IOException
- thrown in case writing the sample caused an I/O
related problem.public int getSamplingRate()
getSamplingRate
in interface SamplingRateAccessor
public void setSamplingRate(int aSamplingRate)
setSamplingRate
in interface SamplingRateAccessor.SamplingRateMutator
aSamplingRate
- The sampling rate to be stored by the sampling
rate property.public LineOutSoundSampleWriter withSamplingRate(int aSamplingRate)
withSamplingRate
in interface SamplingRateAccessor.SamplingRateBuilder<SoundSample>
aSamplingRate
- The sampling rate to be stored by the sampling
rate property.public void close() throws IOException
close
in interface AutoCloseable
close
in interface SampleWriter<SoundSample,LineOutSoundSampleWriter>
IOException
protected SourceDataLine getLineOut() throws LineUnavailableException
SourceDataLine
instance for writing samples
to.SourceDataLine
upon success.LineUnavailableException
- thrown in case the audio-line cannot be
acquired.Copyright © 2021. All rights reserved.