Package wavFiles

Class WavHeader

java.lang.Object
wavFiles.WavHeader

public class WavHeader extends Object
  • Constructor Details Link icon

    • WavHeader Link icon

      public WavHeader()
      Construct a blank Wav Header object, generally used when about to read a header from a file.
    • WavHeader Link icon

      public WavHeader(AudioFormat audioFormat)
      Construct a WavHeader from a Java AudioFormat.
      Parameters:
      audioFormat - Java audio format.
  • Method Details Link icon

    • readHeader Link icon

      public boolean readHeader(WindowsFile windowsWavFile)
      Read the header data from file.
      Parameters:
      windowsWavFile - Windows file
      Returns:
      true if header unpacked successfully.
    • writeHeader Link icon

      public boolean writeHeader(WindowsFile windowsWavFile)
      Read the header data from file.
      Parameters:
      windowsWavFile - Windows file
      Returns:
      true if header unpacked successfully.
    • getAudioFormat Link icon

      public AudioFormat getAudioFormat()
      Returns:
      all data from the header as an AudioFormat object.
    • setFmtTag Link icon

      public void setFmtTag(short fmtTag)
      Parameters:
      fmtTag - the fmtTag to set
    • getFmtTag Link icon

      public int getFmtTag()
      Returns:
      the fmtTag
    • setNChannels Link icon

      public void setNChannels(short nChannels)
      Parameters:
      nChannels - the nChannels to set
    • getNChannels Link icon

      public short getNChannels()
      Returns:
      the nChannels
    • setBlockAlign Link icon

      public void setBlockAlign(short blockAlign)
      Parameters:
      blockAlign - the blockAlign to set
    • getBlockAlign Link icon

      public short getBlockAlign()
      Returns:
      the blockAlign
    • setBitsPerSample Link icon

      public void setBitsPerSample(short bitsPerSample)
      Parameters:
      bitsPerSample - the bitsPerSample to set
    • getBitsPerSample Link icon

      public short getBitsPerSample()
      Returns:
      the bitsPerSample
    • setSampleRate Link icon

      public void setSampleRate(int sampleRate)
      Parameters:
      sampleRate - the sampleRate to set
    • getSampleRate Link icon

      public int getSampleRate()
      Returns:
      the sampleRate
    • setBytesPerSec Link icon

      public void setBytesPerSec(int bytesPerSec)
      Parameters:
      bytesPerSec - the bytesPerSec to set
    • getBytesPerSec Link icon

      public int getBytesPerSec()
      Returns:
      the bytesPerSec
    • setHeaderOk Link icon

      public void setHeaderOk(boolean headerOk)
      Parameters:
      headerOk - the headerOk to set
    • isHeaderOk Link icon

      public boolean isHeaderOk()
      Returns:
      the headerOk
    • setDataStart Link icon

      public void setDataStart(long dataStart)
      Parameters:
      dataStart - the dataStart to set
    • getDataStart Link icon

      public long getDataStart()
      Returns:
      byte number for the start of the data.
    • setDataSize Link icon

      public void setDataSize(long dataSize)
      Parameters:
      dataSize - the dataSize to set
    • getDataSize Link icon

      public long getDataSize()
      Returns:
      the dataSize
    • getNumHeadChunks Link icon

      public int getNumHeadChunks()
      Get the number of additional chunks in the wav header.
      Returns:
      the number of additional chunks in the wav header.
    • getHeadChunk Link icon

      public WavHeadChunk getHeadChunk(int iChunk)
      Get a chunk from the wav header.
      Parameters:
      iChunk - chunk number
      Returns:
      Chunk read from wav header.
    • getHeaderSize Link icon

      public long getHeaderSize()
      Returns:
      the headerSize