Class AbstractCsvSampleReader<S extends SoundSample>

java.lang.Object
org.refcodes.audio.AbstractCsvSampleReader<S>
Type Parameters:
S - The SoundSample (sub-)type on which the SampleWriter 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>
The AbstractCsvSampleReader provides a foundation to read sound samples from a CSV file.
  • Field Details

    • _csvReader

      protected org.refcodes.tabular.CsvStringRecordReader _csvReader
  • Constructor Details

    • AbstractCsvSampleReader

      public AbstractCsvSampleReader​(File aFile) throws ZipException, IOException
      Constructs the AbstractCsvSampleReader for writing sound samples to a CSV file or stream.
      Parameters:
      aFile - The File 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 the AbstractCsvSampleReader for writing sound samples to a CSV file or stream.
      Parameters:
      aInputStream - The InputStream 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 the AbstractCsvSampleReader for writing sound samples to a CSV file or stream.
      Parameters:
      aCsvReader - The CsvStringRecordReader with which to write the CSV records with.
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface org.refcodes.io.RowReader<S extends SoundSample>
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      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.