Module org.refcodes.audio
Package org.refcodes.audio
Interface SampleWriter<S extends SoundSample,B extends SampleWriter<S,B>>
- Type Parameters:
S
- The type of the sample to be used.B
- TheSampleWriter
implementing thisSampleWriter
.
- All Superinterfaces:
AutoCloseable
,org.refcodes.io.RowWriter<S>
,SamplingRateAccessor
,SamplingRateAccessor.SamplingRateBuilder<B>
,SamplingRateAccessor.SamplingRateMutator
,SamplingRateAccessor.SamplingRateProperty
- All Known Subinterfaces:
CsvSampleWriter<S,
,B> LineOutSampleWriter<S,
,B> MonoSampleWriter<B>
,SoundSampleWriter<B>
,WavSampleWriter<S,
B>
- All Known Implementing Classes:
AbstractCsvSampleWriter
,AbstractLineOutSampleWriter
,AbstractSvgSampleWriter
,AbstractWavSampleWriter
,CsvMonoSampleWriter
,CsvSoundSampleWriter
,LineOutMonoSampleWriter
,LineOutSoundSampleWriter
,SvgMonoSampleWriter
,WavMonoSampleWriter
,WavSoundSampleWriter
public interface SampleWriter<S extends SoundSample,B extends SampleWriter<S,B>>
extends AutoCloseable, org.refcodes.io.RowWriter<S>, SamplingRateAccessor.SamplingRateBuilder<B>, SamplingRateAccessor.SamplingRateProperty
The
SampleWriter
writes sound samples to a stream or a file.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.audio.SamplingRateAccessor
SamplingRateAccessor.SamplingRateBuilder<B extends SamplingRateAccessor.SamplingRateBuilder<B>>, SamplingRateAccessor.SamplingRateMutator, SamplingRateAccessor.SamplingRateProperty
-
Method Summary
Methods inherited from interface org.refcodes.audio.SamplingRateAccessor
getSamplingRate
Methods inherited from interface org.refcodes.audio.SamplingRateAccessor.SamplingRateBuilder
withSamplingRate
Methods inherited from interface org.refcodes.audio.SamplingRateAccessor.SamplingRateMutator
setSamplingRate
Methods inherited from interface org.refcodes.audio.SamplingRateAccessor.SamplingRateProperty
letSamplingRate
-
Method Details
-
writeNext
Writes the next samples, one sample for each channel. Provide one sample for mono audio, two samples for stereo audio and so on. In case you provide more or less samples than channels being supported by the writer, then it is up to the writer whether to duplicate the samples or calculate an average or the like.- Specified by:
writeNext
in interfaceorg.refcodes.io.RowWriter<S extends SoundSample>
- Parameters:
aSample
- The samples, one for each channel.- Throws:
IOException
- thrown in case writing the sample caused an I/O related problem.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-