Class WavFileInfo


  • public class WavFileInfo
    extends java.lang.Object
    WAV file format information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int bitsPerSample
      Bits per sample (currently only 16 supported).
      int blockAlign
      Size of a block (one sample for each channel + padding).
      long blockCount
      Number of blocks in the file.
      int channelCount
      Number of channels.
      int sampleRate
      Sample rate.
      long startOffset
      Starting position of the raw PCM samples in the file.
    • Constructor Summary

      Constructors 
      Constructor Description
      WavFileInfo​(int channelCount, int sampleRate, int bitsPerSample, int blockAlign, long blockCount, long startOffset)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getDuration()  
      int getPadding()  
      • Methods inherited from class java.lang.Object

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

      • channelCount

        public final int channelCount
        Number of channels.
      • sampleRate

        public final int sampleRate
        Sample rate.
      • bitsPerSample

        public final int bitsPerSample
        Bits per sample (currently only 16 supported).
      • blockAlign

        public final int blockAlign
        Size of a block (one sample for each channel + padding).
      • blockCount

        public final long blockCount
        Number of blocks in the file.
      • startOffset

        public final long startOffset
        Starting position of the raw PCM samples in the file.
    • Constructor Detail

      • WavFileInfo

        public WavFileInfo​(int channelCount,
                           int sampleRate,
                           int bitsPerSample,
                           int blockAlign,
                           long blockCount,
                           long startOffset)
        Parameters:
        channelCount - Number of channels.
        sampleRate - Sample rate.
        bitsPerSample - Bits per sample (currently only 16 supported).
        blockAlign - Size of a block (one sample for each channel + padding).
        blockCount - Number of blocks in the file.
        startOffset - Starting position of the raw PCM samples in the file.
    • Method Detail

      • getDuration

        public long getDuration()
        Returns:
        Duration of the file in milliseconds.
      • getPadding

        public int getPadding()
        Returns:
        The size of padding in a sample block in bytes.