AutoCloseable
, CsvSampleWriter<SoundSample,B>
, SampleWriter<SoundSample,B>
, SamplingRateAccessor
, SamplingRateAccessor.SamplingRateBuilder<CsvSoundSampleWriter>
, SamplingRateAccessor.SamplingRateMutator
, SamplingRateAccessor.SamplingRateProperty
, SoundSampleWriter<CsvSoundSampleWriter>
, org.refcodes.io.RowWriter<CsvSoundSampleWriter>
public class CsvSoundSampleWriter extends AbstractCsvSampleWriter<SoundSample,CsvSoundSampleWriter> implements SoundSampleWriter<CsvSoundSampleWriter>
CsvSoundSampleWriter
provides means to write sound samples to a
CSV file.SamplingRateAccessor.SamplingRateBuilder<B extends SamplingRateAccessor.SamplingRateBuilder<B>>, SamplingRateAccessor.SamplingRateMutator, SamplingRateAccessor.SamplingRateProperty
_csvWriter, _deltaMode
Constructor | Description |
---|---|
CsvSoundSampleWriter(File aFile) |
Constructs the
CsvSoundSampleWriter for writing sound samples to
a CSV file or stream. |
CsvSoundSampleWriter(File aFile,
CsvDeltaMode aDeltaMode) |
Constructs the
CsvSoundSampleWriter for writing sound samples to
a CSV file or stream. |
CsvSoundSampleWriter(OutputStream aOutputStream) |
Constructs the
CsvSoundSampleWriter for writing sound samples to
a CSV file or stream. |
CsvSoundSampleWriter(OutputStream aOutputStream,
CsvDeltaMode aDeltaMode) |
Constructs the
CsvSoundSampleWriter for writing sound samples to
a CSV file or stream. |
CsvSoundSampleWriter(PrintStream aPrintStream) |
Constructs the
CsvSoundSampleWriter for writing sound samples to
a CSV file or stream. |
CsvSoundSampleWriter(PrintStream aPrintStream,
CsvDeltaMode aDeltaMode) |
Constructs the
CsvSoundSampleWriter for writing sound samples to
a CSV file or stream. |
Modifier and Type | Method | Description |
---|---|---|
int |
getSamplingRate() |
Retrieves the sampling rate from the sampling rate property.
|
void |
setSamplingRate(int aSamplingRate) |
Sets the sampling rate for the sampling rate property.
|
CsvSoundSampleWriter |
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.
|
close, format, toDouble, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
letSamplingRate
public CsvSoundSampleWriter(File aFile) throws FileNotFoundException
CsvSoundSampleWriter
for writing sound samples to
a CSV file or stream.aFile
- The File
where to write the CSV records to.FileNotFoundException
- If the given file object does not denote an
existing, writable regular file and a new regular file of that
name cannot be created, or if some other error occurs while
opening or creating the file.public CsvSoundSampleWriter(OutputStream aOutputStream)
CsvSoundSampleWriter
for writing sound samples to
a CSV file or stream.aOutputStream
- The OutputStream
where to write the CSV
records to.public CsvSoundSampleWriter(PrintStream aPrintStream)
CsvSoundSampleWriter
for writing sound samples to
a CSV file or stream.aPrintStream
- The PrintStream
where to write the CSV
records to.public CsvSoundSampleWriter(File aFile, CsvDeltaMode aDeltaMode) throws FileNotFoundException
CsvSoundSampleWriter
for writing sound samples to
a CSV file or stream.aFile
- The File
where to write the CSV records to.aDeltaMode
- The CsvDeltaMode
to use when writing the CSV
rows.FileNotFoundException
- If the given file object does not denote an
existing, writable regular file and a new regular file of that
name cannot be created, or if some other error occurs while
opening or creating the file.public CsvSoundSampleWriter(OutputStream aOutputStream, CsvDeltaMode aDeltaMode)
CsvSoundSampleWriter
for writing sound samples to
a CSV file or stream.aOutputStream
- The OutputStream
where to write the CSV
records to.aDeltaMode
- The CsvDeltaMode
to use when writing the CSV
rows.public CsvSoundSampleWriter(PrintStream aPrintStream, CsvDeltaMode aDeltaMode)
CsvSoundSampleWriter
for writing sound samples to
a CSV file or stream.aPrintStream
- The PrintStream
where to write the CSV
records to.aDeltaMode
- The CsvDeltaMode
to use when writing the CSV
rows.public void writeNext(double... aSampleData)
writeNext
in interface SoundSampleWriter<CsvSoundSampleWriter>
aSampleData
- The samples, one for each channel.public void writeNext(SoundSample aSample)
writeNext
in interface org.refcodes.io.RowWriter<CsvSoundSampleWriter>
writeNext
in interface SampleWriter<SoundSample,B extends SoundSampleWriter<B>>
writeNext
in interface SoundSampleWriter<CsvSoundSampleWriter>
aSample
- The samples, one for each channel.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 CsvSoundSampleWriter withSamplingRate(int aSamplingRate)
withSamplingRate
in interface SamplingRateAccessor.SamplingRateBuilder<CsvSoundSampleWriter>
aSamplingRate
- The sampling rate to be stored by the sampling
rate property.Copyright © 2021. All rights reserved.