Package wavFiles
Class WavHeader
java.lang.Object
wavFiles.WavHeader
- 
Constructor Summary
ConstructorsConstructorDescriptionConstruct a blank Wav Header object, generally used when about to read a header from a file.WavHeader(AudioFormat audioFormat) Construct a WavHeader from a Java AudioFormat. - 
Method Summary
Modifier and TypeMethodDescriptionshortshortintlonglongintgetHeadChunk(int iChunk) Get a chunk from the wav header.longshortintGet the number of additional chunks in the wav header.intbooleanbooleanreadHeader(WindowsFile windowsWavFile) Read the header data from file.voidsetBitsPerSample(short bitsPerSample) voidsetBlockAlign(short blockAlign) voidsetBytesPerSec(int bytesPerSec) voidsetDataSize(long dataSize) voidsetDataStart(long dataStart) voidsetFmtTag(short fmtTag) voidsetHeaderOk(boolean headerOk) voidsetNChannels(short nChannels) voidsetSampleRate(int sampleRate) booleanwriteHeader(WindowsFile windowsWavFile) Read the header data from file. 
- 
Constructor Details
- 
WavHeader
public WavHeader()Construct a blank Wav Header object, generally used when about to read a header from a file. - 
WavHeader
Construct a WavHeader from a Java AudioFormat.- Parameters:
 audioFormat- Java audio format.
 
 - 
 - 
Method Details
- 
readHeader
Read the header data from file.- Parameters:
 windowsWavFile- Windows file- Returns:
 - true if header unpacked successfully.
 
 - 
writeHeader
Read the header data from file.- Parameters:
 windowsWavFile- Windows file- Returns:
 - true if header unpacked successfully.
 
 - 
getAudioFormat
- Returns:
 - all data from the header as an AudioFormat object.
 
 - 
setFmtTag
public void setFmtTag(short fmtTag) - Parameters:
 fmtTag- the fmtTag to set
 - 
getFmtTag
public int getFmtTag()- Returns:
 - the fmtTag
 
 - 
setNChannels
public void setNChannels(short nChannels) - Parameters:
 nChannels- the nChannels to set
 - 
getNChannels
public short getNChannels()- Returns:
 - the nChannels
 
 - 
setBlockAlign
public void setBlockAlign(short blockAlign) - Parameters:
 blockAlign- the blockAlign to set
 - 
getBlockAlign
public short getBlockAlign()- Returns:
 - the blockAlign
 
 - 
setBitsPerSample
public void setBitsPerSample(short bitsPerSample) - Parameters:
 bitsPerSample- the bitsPerSample to set
 - 
getBitsPerSample
public short getBitsPerSample()- Returns:
 - the bitsPerSample
 
 - 
setSampleRate
public void setSampleRate(int sampleRate) - Parameters:
 sampleRate- the sampleRate to set
 - 
getSampleRate
public int getSampleRate()- Returns:
 - the sampleRate
 
 - 
setBytesPerSec
public void setBytesPerSec(int bytesPerSec) - Parameters:
 bytesPerSec- the bytesPerSec to set
 - 
getBytesPerSec
public int getBytesPerSec()- Returns:
 - the bytesPerSec
 
 - 
setHeaderOk
public void setHeaderOk(boolean headerOk) - Parameters:
 headerOk- the headerOk to set
 - 
isHeaderOk
public boolean isHeaderOk()- Returns:
 - the headerOk
 
 - 
setDataStart
public void setDataStart(long dataStart) - Parameters:
 dataStart- the dataStart to set
 - 
getDataStart
public long getDataStart()- Returns:
 - byte number for the start of the data.
 
 - 
setDataSize
public void setDataSize(long dataSize) - Parameters:
 dataSize- the dataSize to set
 - 
getDataSize
public long getDataSize()- Returns:
 - the dataSize
 
 - 
getNumHeadChunks
public int getNumHeadChunks()Get the number of additional chunks in the wav header.- Returns:
 - the number of additional chunks in the wav header.
 
 - 
getHeadChunk
Get a chunk from the wav header.- Parameters:
 iChunk- chunk number- Returns:
 - Chunk read from wav header.
 
 - 
getHeaderSize
public long getHeaderSize()- Returns:
 - the headerSize
 
 - 
getHarpHeader
- Returns:
 - the harpHeader
 
 
 -