Module org.refcodes.audio
Package org.refcodes.audio
Class AbstractCsvSampleReader<S extends SoundSample>
- java.lang.Object
-
- org.refcodes.audio.AbstractCsvSampleReader<S>
-
- Type Parameters:
S
- TheSoundSample
(sub-)type on which theSampleWriter
implementation is to operate on.
- All Implemented Interfaces:
AutoCloseable
,SampleReader<S>
,SamplingRateAccessor
,org.refcodes.io.RowReader<S>
,org.refcodes.mixin.IndexAccessor
- Direct Known Subclasses:
CsvMonoSampleReader
,CsvSoundSampleReader
public abstract class AbstractCsvSampleReader<S extends SoundSample> extends Object implements SampleReader<S>
TheAbstractCsvSampleReader
provides a foundation to read sound samples from a CSV file.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.IndexAccessor
org.refcodes.mixin.IndexAccessor.IndexBuilder<B extends org.refcodes.mixin.IndexAccessor.IndexBuilder<B>>, org.refcodes.mixin.IndexAccessor.IndexMutator, org.refcodes.mixin.IndexAccessor.IndexProperty
-
Nested classes/interfaces inherited from interface org.refcodes.audio.SamplingRateAccessor
SamplingRateAccessor.SamplingRateBuilder<B extends SamplingRateAccessor.SamplingRateBuilder<B>>, SamplingRateAccessor.SamplingRateMutator, SamplingRateAccessor.SamplingRateProperty
-
-
Field Summary
Fields Modifier and Type Field Description protected org.refcodes.tabular.CsvStringRecordReader
_csvReader
-
Constructor Summary
Constructors Modifier Constructor Description AbstractCsvSampleReader(File aFile)
Constructs theAbstractCsvSampleReader
for writing sound samples to a CSV file or stream.AbstractCsvSampleReader(InputStream aInputStream)
Constructs theAbstractCsvSampleReader
for writing sound samples to a CSV file or stream.protected
AbstractCsvSampleReader(org.refcodes.tabular.CsvStringRecordReader aCsvReader)
Constructs theAbstractCsvSampleReader
for writing sound samples to a CSV file or stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
doProbeHeader()
Reads the header if it has not been read yet.boolean
hasNext()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.audio.SampleReader
nextSample
-
Methods inherited from interface org.refcodes.audio.SamplingRateAccessor
getSamplingRate
-
-
-
-
Constructor Detail
-
AbstractCsvSampleReader
public AbstractCsvSampleReader(File aFile) throws ZipException, IOException
Constructs theAbstractCsvSampleReader
for writing sound samples to a CSV file or stream.- Parameters:
aFile
- TheFile
where to write the CSV records to.- Throws:
IOException
- thrown in case there was an I/O related problem.ZipException
- Signals that a Zip exception of some sort has occurred.
-
AbstractCsvSampleReader
public AbstractCsvSampleReader(InputStream aInputStream) throws IOException
Constructs theAbstractCsvSampleReader
for writing sound samples to a CSV file or stream.- Parameters:
aInputStream
- TheInputStream
where to write the CSV records to.- Throws:
IOException
- thrown in case there was an I/O related problem.
-
AbstractCsvSampleReader
protected AbstractCsvSampleReader(org.refcodes.tabular.CsvStringRecordReader aCsvReader)
Constructs theAbstractCsvSampleReader
for writing sound samples to a CSV file or stream.- Parameters:
aCsvReader
- TheCsvStringRecordReader
with which to write the CSV records with.
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceorg.refcodes.io.RowReader<S extends SoundSample>
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
doProbeHeader
protected void doProbeHeader() throws IOException
Reads the header if it has not been read yet.- Throws:
IOException
- thrown in case of an IO related problem.
-
-