Package 

Class WaveReader

    • Constructor Summary

      Constructors 
      Constructor Description
      WaveReader(String path, String name) Constructor; initializes WaveReader to read from given file
      WaveReader(File file) Constructor; initializes WaveReader to read from given file
    • Method Summary

      Modifier and Type Method Description
      void openWave() Open WAV file for reading
      int getSampleRate() Get sample rate
      int getChannels() Get number of channels
      int getPcmFormat() Get PCM format, S16LE or S8LE
      int getFileSize() Get file size
      int getDataSize() Get input file's audio data sizeBasically file size without headers included
      int getLength() Get input file length
      int read(Array<short> dst, int numSamples) Read audio data from input file (mono)
      int read(Array<short> left, Array<short> right, int numSamples) Read audio data from input file (stereo)
      void closeWaveFile() Close WAV file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WaveReader

        WaveReader(String path, String name)
        Constructor; initializes WaveReader to read from given file
        Parameters:
        path - path to input file
        name - name of input file
      • WaveReader

        WaveReader(File file)
        Constructor; initializes WaveReader to read from given file
        Parameters:
        file - handle to input file
    • Method Detail

      • openWave

         void openWave()

        Open WAV file for reading

      • getPcmFormat

         int getPcmFormat()

        Get PCM format, S16LE or S8LE

      • getDataSize

         int getDataSize()

        Get input file's audio data sizeBasically file size without headers included

      • getLength

         int getLength()

        Get input file length

      • read

         int read(Array<short> dst, int numSamples)

        Read audio data from input file (mono)

        Parameters:
        dst - mono audio data output buffer
        numSamples - number of samples to read
      • read

         int read(Array<short> left, Array<short> right, int numSamples)

        Read audio data from input file (stereo)

        Parameters:
        left - left channel audio output buffer
        right - right channel audio output buffer
        numSamples - number of samples to read
      • closeWaveFile

         void closeWaveFile()

        Close WAV file. WaveReader object cannot be used again following this call.