Class AbstractAVIStream.AudioTrack

java.lang.Object
org.monte.media.avi.AbstractAVIStream.Track
org.monte.media.avi.AbstractAVIStream.AudioTrack
Enclosing class:
AbstractAVIStream

protected class AbstractAVIStream.AudioTrack extends AbstractAVIStream.Track

The format of a video track is defined in a "strf" chunk, which contains a WAVEFORMATEX struct.

 ----------------------
 AVI Wave Format Header
 ----------------------
 // values for this enum taken from mmreg.h
 enum {
         WAVE_FORMAT_PCM = 0x0001,
         //  Microsoft Corporation
         WAVE_FORMAT_ADPCM = 0x0002,
         //  Microsoft Corporation
          *   IEEE754: range (+1, -1]
          *  32-bit/64-bit format as defined by
          *  MSVC++ float/double type

         WAVE_FORMAT_IEEE_FLOAT = 0x0003,
         //  IBM Corporation
         WAVE_FORMAT_IBM_CVSD = 0x0005,
         //  Microsoft Corporation
         WAVE_FORMAT_ALAW = 0x0006,
         //  Microsoft Corporation
         WAVE_FORMAT_MULAW = 0x0007,
         //  OKI
         WAVE_FORMAT_OKI_ADPCM = 0x0010,
         //  Intel Corporation
         WAVE_FORMAT_DVI_ADPCM = 0x0011,
         //  Intel Corporation
         WAVE_FORMAT_IMA_ADPCM = 0x0011,
         //  Videologic
         WAVE_FORMAT_MEDIASPACE_ADPCM = 0x0012,
         //  Sierra Semiconductor Corp
         WAVE_FORMAT_SIERRA_ADPCM = 0x0013,
         //  Antex Electronics Corporation
         WAVE_FORMAT_G723_ADPCM = 0x0014,
         //  DSP Solutions, Inc.
         WAVE_FORMAT_DIGISTD = 0x0015,
         //  DSP Solutions, Inc.
         WAVE_FORMAT_DIGIFIX = 0x0016,
         //  Dialogic Corporation
         WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 0x0017,
         //  Media Vision, Inc.
         WAVE_FORMAT_MEDIAVISION_ADPCM = 0x0018,
         //  Yamaha Corporation of America
         WAVE_FORMAT_YAMAHA_ADPCM = 0x0020,
         //  Speech Compression
         WAVE_FORMAT_SONARC = 0x0021,
         //  DSP Group, Inc
         WAVE_FORMAT_DSPGROUP_TRUESPEECH = 0x0022,
         //  Echo Speech Corporation
         WAVE_FORMAT_ECHOSC1 = 0x0023,
         //
         WAVE_FORMAT_AUDIOFILE_AF36 = 0x0024,
         //  Audio Processing Technology
         WAVE_FORMAT_APTX = 0x0025,
         //
         WAVE_FORMAT_AUDIOFILE_AF10 = 0x0026,
         //  Dolby Laboratories
         WAVE_FORMAT_DOLBY_AC2 = 0x0030,
         //  Microsoft Corporation
         WAVE_FORMAT_GSM610 = 0x0031,
         //  Microsoft Corporation
         WAVE_FORMAT_MSNAUDIO = 0x0032,
         //  Antex Electronics Corporation
         WAVE_FORMAT_ANTEX_ADPCME = 0x0033,
         //  Control Resources Limited
         WAVE_FORMAT_CONTROL_RES_VQLPC = 0x0034,
         //  DSP Solutions, Inc.
         WAVE_FORMAT_DIGIREAL = 0x0035,
         //  DSP Solutions, Inc.
         WAVE_FORMAT_DIGIADPCM = 0x0036,
         //  Control Resources Limited
         WAVE_FORMAT_CONTROL_RES_CR10 = 0x0037,
         //  Natural MicroSystems
         WAVE_FORMAT_NMS_VBXADPCM = 0x0038,
         // Crystal Semiconductor IMA ADPCM
         WAVE_FORMAT_CS_IMAADPCM = 0x0039,
         // Echo Speech Corporation
         WAVE_FORMAT_ECHOSC3 = 0x003A,
         // Rockwell International
         WAVE_FORMAT_ROCKWELL_ADPCM = 0x003B,
         // Rockwell International
         WAVE_FORMAT_ROCKWELL_DIGITALK = 0x003C,
         // Xebec Multimedia Solutions Limited
         WAVE_FORMAT_XEBEC = 0x003D,
         //  Antex Electronics Corporation
         WAVE_FORMAT_G721_ADPCM = 0x0040,
         //  Antex Electronics Corporation
         WAVE_FORMAT_G728_CELP = 0x0041,
         //  Microsoft Corporation
         WAVE_FORMAT_MPEG = 0x0050,
         //  ISO/MPEG Layer3 Format Tag
         WAVE_FORMAT_MPEGLAYER3 = 0x0055,
         //  Cirrus Logic
         WAVE_FORMAT_CIRRUS = 0x0060,
         //  ESS Technology
         WAVE_FORMAT_ESPCM = 0x0061,
         //  Voxware Inc
         WAVE_FORMAT_VOXWARE = 0x0062,
         //  Canopus, co., Ltd.
         WAVE_FORMAT_CANOPUS_ATRAC = 0x0063,
         //  APICOM
         WAVE_FORMAT_G726_ADPCM = 0x0064,
         //  APICOM
         WAVE_FORMAT_G722_ADPCM = 0x0065,
         //  Microsoft Corporation
         WAVE_FORMAT_DSAT = 0x0066,
         //  Microsoft Corporation
         WAVE_FORMAT_DSAT_DISPLAY = 0x0067,
         //  Softsound, Ltd.
         WAVE_FORMAT_SOFTSOUND = 0x0080,
         //  Rhetorex Inc
         WAVE_FORMAT_RHETOREX_ADPCM = 0x0100,
         //  Creative Labs, Inc
         WAVE_FORMAT_CREATIVE_ADPCM = 0x0200,
         //  Creative Labs, Inc
         WAVE_FORMAT_CREATIVE_FASTSPEECH8 = 0x0202,
         //  Creative Labs, Inc
         WAVE_FORMAT_CREATIVE_FASTSPEECH10 = 0x0203,
         //  Quarterdeck Corporation
         WAVE_FORMAT_QUARTERDECK = 0x0220,
         //  Fujitsu Corp.
         WAVE_FORMAT_FM_TOWNS_SND = 0x0300,
         //  Brooktree Corporation
         WAVE_FORMAT_BTV_DIGITAL = 0x0400,
         //  Ing C. Olivetti + C., S.p.A.
         WAVE_FORMAT_OLIGSM = 0x1000,
         //  Ing C. Olivetti + C., S.p.A.
         WAVE_FORMAT_OLIADPCM = 0x1001,
         //  Ing C. Olivetti + C., S.p.A.
         WAVE_FORMAT_OLICELP = 0x1002,
         //  Ing C. Olivetti + C., S.p.A.
         WAVE_FORMAT_OLISBC = 0x1003,
         //  Ing C. Olivetti + C., S.p.A.
         WAVE_FORMAT_OLIOPR = 0x1004,
         //  Lernout + Hauspie
         WAVE_FORMAT_LH_CODEC = 0x1100,
         //  Norris Communications, Inc.
         WAVE_FORMAT_NORRIS = 0x1400,
         //
          *  the WAVE_FORMAT_DEVELOPMENT format tag can be used during the
          *  development phase of a new wave format.  Before shipping, you MUST
          *  acquire an official format tag from Microsoft.

         WAVE_FORMAT_DEVELOPMENT = 0xFFFF,
 } wFormatTagEnum;

 typedef struct {
   WORD enum wFormatTagEnum formatTag;
     // Waveform-audio format type. Format tags are registered with Microsoft
     // Corporation for many compression algorithms. A complete list of format
     // tags can be found in the Mmreg.h header file. For one- or two-channel
     // Pulse Code Modulation (PCM) data, this value should be WAVE_FORMAT_PCM.
   WORD  numberOfChannels;
     // Number of channels in the waveform-audio data. Monaural data uses one
     // channel and stereo data uses two channels.
   DWORD samplesPerSec;
     // Sample rate, in samples per second (hertz). If "formatTag" is
     // "WAVE_FORMAT_PCM", then common values for "samplesPerSec" are 8.0 kHz,
     // 11.025 kHz, 22.05 kHz, and 44.1 kHz. For non-PCM formats, this member
     // must be computed according to the manufacturer's specification of the
     // format tag.
   DWORD avgBytesPerSec;
     // Required average data-transfer rate, in bytes per second, for the format
     // tag. If "formatTag" is "WAVE_FORMAT_PCM", "avgBytesPerSec" should be
     // equal to the product of "samplesPerSec" and "blockAlignment". For non-PCM
     // formats, this member must be computed according to the manufacturer's
     // specification of the format tag.
   WORD  blockAlignment;
     // Block alignment, in bytes. The block alignment is the minimum atomic unit
     // of data for the "formatTag" format type. If "formatTag" is
     // "WAVE_FORMAT_PCM" or "WAVE_FORMAT_EXTENSIBLE, "blockAlignment" must be equal
     // to the product of "numberOfChannels" and "bitsPerSample" divided by 8 (bits per
     // byte). For non-PCM formats, this member must be computed according to the
     // manufacturer's specification of the format tag.
     // Software must process a multiple of "blockAlignment" bytes of data at a
     // time. Data written to and read from a device must always start at the
     // beginning of a block. For example, it is illegal to start playback of PCM
     // data in the middle of a sample (that is, on a non-block-aligned boundary).
   WORD  bitsPerSample;
     // Bits per sample for the waveFormatTag format type. If "formatTag" is
     // "WAVE_FORMAT_PCM", then "bitsPerSample" should be equal to 8 or 16. For
     // non-PCM formats, this member must be set according to the manufacturer's
     // specification of the format tag. If "formatTag" is
     // "WAVE_FORMAT_EXTENSIBLE", this value can be any integer multiple of 8.
     // Some compression schemes cannot define a value for "bitsPerSample", so
     // this member can be zero.
   WORD  cbSize;
     // Size, in bytes, of extra format information appended to the end of the
     // WAVEFORMATEX structure. This information can be used by non-PCM formats
     // to store extra attributes for the "wFormatTag". If no extra information
     // is required by the "wFormatTag", this member must be set to zero. For
     // WAVE_FORMAT_PCM formats (and only WAVE_FORMAT_PCM formats), this member
     // is ignored.
   byte[cbSize] extra;
 } WAVEFORMATEX;
 
  • Field Details

    • wFormatTag

      protected int wFormatTag
      Waveform-audio format type. Format tags are registered with Microsoft Corporation for many compression algorithms. A complete list of format tags can be found in the Mmreg.h header file. For one- or two-channel Pulse Code Modulation (PCM) data, this value should be WAVE_FORMAT_PCM=0x0001.

      If wFormatTag equals WAVE_FORMAT_EXTENSIBLE=0xFFFE, the structure is interpreted as a WAVEFORMATEXTENSIBLE structure. If wFormatTag equals WAVE_FORMAT_MPEG, the structure is interpreted as an MPEG1WAVEFORMAT structure. If wFormatTag equals MPEGLAYER3WAVEFORMAT, the structure is interpreted as an MPEGLAYER3WAVEFORMAT structure. Before reinterpreting a WAVEFORMATEX structure as one of these extended structures, verify that the actual structure size is sufficiently large and that the cbSize member indicates a valid size.

    • channels

      protected int channels
      Number of channels in the waveform-audio data. Monaural data uses one channel and stereo data uses two channels.
    • samplesPerSec

      protected long samplesPerSec
      Sample rate, in samples per second (hertz). If wFormatTag is WAVE_FORMAT_PCM, then common values for samplesPerSec are 8.0 kHz, 11.025 kHz, 22.05 kHz, and 44.1 kHz. For non-PCM formats, this member must be computed according to the manufacturer's specification of the format tag.
    • avgBytesPerSec

      protected long avgBytesPerSec
      Required average data-transfer rate, in bytes per second, for the format tag. If wFormatTag is WAVE_FORMAT_PCM, avgBytesPerSec should be equal to the product of samplesPerSec and blockAlign. For non-PCM formats, this member must be computed according to the manufacturer's specification of the format tag.
    • blockAlign

      protected int blockAlign
      Block alignment, in bytes. The block alignment is the minimum atomic unit of data for the wFormatTag format type. If wFormatTag is WAVE_FORMAT_PCM or WAVE_FORMAT_EXTENSIBLE, blockAlign must be equal to the product of channels and bitsPerSample divided by 8 (bits per byte). For non-PCM formats, this member must be computed according to the manufacturer's specification of the format tag.

      Software must process a multiple of blockAlign bytes of data at a time. Data written to and read from a device must always startTime at the beginning of a block. For example, it is illegal to startTime playback of PCM data in the middle of a sample (that is, on a non-block-aligned boundary).

    • bitsPerSample

      protected int bitsPerSample
      Bits per sample for the wFormatTag format type. If wFormatTag is WAVE_FORMAT_PCM, then bitsPerSample should be equal to 8 or 16. For non-PCM formats, this member must be set according to the manufacturer's specification of the format tag. If wFormatTag is WAVE_FORMAT_EXTENSIBLE, this value can be any integer multiple of 8. Some compression schemes cannot define a value for bitsPerSample, so this member can be zero.
    • WAVE_FORMAT_PCM

      protected static final int WAVE_FORMAT_PCM
      Microsoft Corporation
      See Also:
    • WAVE_FORMAT_ADPCM

      protected static final int WAVE_FORMAT_ADPCM
      Microsoft Corporation
      See Also:
    • WAVE_FORMAT_IEEE_FLOAT

      protected static final int WAVE_FORMAT_IEEE_FLOAT
      Microsoft Corporation IEEE754: range (+1, -1] 32-bit/64-bit format as defined by MSVC++ float/double type
      See Also:
    • WAVE_FORMAT_IBM_CVSD

      protected static final int WAVE_FORMAT_IBM_CVSD
      IBM Corporation
      See Also:
    • WAVE_FORMAT_ALAW

      protected static final int WAVE_FORMAT_ALAW
      Microsoft Corporation
      See Also:
    • WAVE_FORMAT_MULAW

      protected static final int WAVE_FORMAT_MULAW
      Microsoft Corporation
      See Also:
    • WAVE_FORMAT_OKI_ADPCM

      protected static final int WAVE_FORMAT_OKI_ADPCM
      OKI
      See Also:
    • WAVE_FORMAT_DVI_ADPCM

      protected static final int WAVE_FORMAT_DVI_ADPCM
      Intel Corporation
      See Also:
    • WAVE_FORMAT_IMA_ADPCM

      protected static final int WAVE_FORMAT_IMA_ADPCM
      Intel Corporation
      See Also:
    • WAVE_FORMAT_MEDIASPACE_ADPCM

      protected static final int WAVE_FORMAT_MEDIASPACE_ADPCM
      Videologic
      See Also:
    • WAVE_FORMAT_SIERRA_ADPCM

      protected static final int WAVE_FORMAT_SIERRA_ADPCM
      Sierra Semiconductor Corp
      See Also:
    • WAVE_FORMAT_G723_ADPCM

      protected static final int WAVE_FORMAT_G723_ADPCM
      Antex Electronics Corporation
      See Also:
    • WAVE_FORMAT_DIGISTD

      protected static final int WAVE_FORMAT_DIGISTD
      DSP Solutions, Inc.
      See Also:
    • WAVE_FORMAT_DIGIFIX

      protected static final int WAVE_FORMAT_DIGIFIX
      DSP Solutions, Inc.
      See Also:
    • WAVE_FORMAT_DIALOGIC_OKI_ADPCM

      protected static final int WAVE_FORMAT_DIALOGIC_OKI_ADPCM
      Dialogic Corporation
      See Also:
    • WAVE_FORMAT_MEDIAVISION_ADPCM

      protected static final int WAVE_FORMAT_MEDIAVISION_ADPCM
      Media Vision, Inc.
      See Also:
    • WAVE_FORMAT_YAMAHA_ADPCM

      protected static final int WAVE_FORMAT_YAMAHA_ADPCM
      Yamaha Corporation of America
      See Also:
    • WAVE_FORMAT_SONARC

      protected static final int WAVE_FORMAT_SONARC
      Speech Compression
      See Also:
    • WAVE_FORMAT_DSPGROUP_TRUESPEECH

      protected static final int WAVE_FORMAT_DSPGROUP_TRUESPEECH
      DSP Group, Inc
      See Also:
    • WAVE_FORMAT_ECHOSC1

      protected static final int WAVE_FORMAT_ECHOSC1
      Echo Speech Corporation
      See Also:
    • WAVE_FORMAT_AUDIOFILE_AF36

      protected static final int WAVE_FORMAT_AUDIOFILE_AF36
      See Also:
    • WAVE_FORMAT_APTX

      protected static final int WAVE_FORMAT_APTX
      Audio Processing Technology
      See Also:
    • WAVE_FORMAT_AUDIOFILE_AF10

      protected static final int WAVE_FORMAT_AUDIOFILE_AF10
      See Also:
    • WAVE_FORMAT_DOLBY_AC2

      protected static final int WAVE_FORMAT_DOLBY_AC2
      Dolby Laboratories
      See Also:
    • WAVE_FORMAT_GSM610

      protected static final int WAVE_FORMAT_GSM610
      Microsoft Corporation
      See Also:
    • WAVE_FORMAT_MSNAUDIO

      protected static final int WAVE_FORMAT_MSNAUDIO
      Microsoft Corporation
      See Also:
    • WAVE_FORMAT_ANTEX_ADPCME

      protected static final int WAVE_FORMAT_ANTEX_ADPCME
      Antex Electronics Corporation
      See Also:
    • WAVE_FORMAT_CONTROL_RES_VQLPC

      protected static final int WAVE_FORMAT_CONTROL_RES_VQLPC
      Control Resources Limited
      See Also:
    • WAVE_FORMAT_DIGIREAL

      protected static final int WAVE_FORMAT_DIGIREAL
      DSP Solutions, Inc.
      See Also:
    • WAVE_FORMAT_DIGIADPCM

      protected static final int WAVE_FORMAT_DIGIADPCM
      DSP Solutions, Inc.
      See Also:
    • WAVE_FORMAT_CONTROL_RES_CR10

      protected static final int WAVE_FORMAT_CONTROL_RES_CR10
      Control Resources Limited
      See Also:
    • WAVE_FORMAT_NMS_VBXADPCM

      protected static final int WAVE_FORMAT_NMS_VBXADPCM
      Natural MicroSystems
      See Also:
    • WAVE_FORMAT_CS_IMAADPCM

      protected static final int WAVE_FORMAT_CS_IMAADPCM
      Crystal Semiconductor IMA ADPCM
      See Also:
    • WAVE_FORMAT_ECHOSC3

      protected static final int WAVE_FORMAT_ECHOSC3
      Echo Speech Corporation
      See Also:
    • WAVE_FORMAT_ROCKWELL_ADPCM

      protected static final int WAVE_FORMAT_ROCKWELL_ADPCM
      Rockwell International
      See Also:
    • WAVE_FORMAT_ROCKWELL_DIGITALK

      protected static final int WAVE_FORMAT_ROCKWELL_DIGITALK
      Rockwell International
      See Also:
    • WAVE_FORMAT_XEBEC

      protected static final int WAVE_FORMAT_XEBEC
      Xebec Multimedia Solutions Limited
      See Also:
    • WAVE_FORMAT_G721_ADPCM

      protected static final int WAVE_FORMAT_G721_ADPCM
      Antex Electronics Corporation
      See Also:
    • WAVE_FORMAT_G728_CELP

      protected static final int WAVE_FORMAT_G728_CELP
      Antex Electronics Corporation
      See Also:
    • WAVE_FORMAT_MPEG

      protected static final int WAVE_FORMAT_MPEG
      Microsoft Corporation
      See Also:
    • WAVE_FORMAT_MPEGLAYER3

      protected static final int WAVE_FORMAT_MPEGLAYER3
      ISO/MPEG Layer3 Format Tag
      See Also:
    • WAVE_FORMAT_CIRRUS

      protected static final int WAVE_FORMAT_CIRRUS
      Cirrus Logic
      See Also:
    • WAVE_FORMAT_ESPCM

      protected static final int WAVE_FORMAT_ESPCM
      ESS Technology
      See Also:
    • WAVE_FORMAT_VOXWARE

      protected static final int WAVE_FORMAT_VOXWARE
      Voxware Inc
      See Also:
    • WAVE_FORMAT_CANOPUS_ATRAC

      protected static final int WAVE_FORMAT_CANOPUS_ATRAC
      Canopus, co., Ltd.
      See Also:
    • WAVE_FORMAT_G726_ADPCM

      protected static final int WAVE_FORMAT_G726_ADPCM
      APICOM
      See Also:
    • WAVE_FORMAT_G722_ADPCM

      protected static final int WAVE_FORMAT_G722_ADPCM
      APICOM
      See Also:
    • WAVE_FORMAT_DSAT

      protected static final int WAVE_FORMAT_DSAT
      Microsoft Corporation
      See Also:
    • WAVE_FORMAT_DSAT_DISPLAY

      protected static final int WAVE_FORMAT_DSAT_DISPLAY
      Microsoft Corporation
      See Also:
    • WAVE_FORMAT_SOFTSOUND

      protected static final int WAVE_FORMAT_SOFTSOUND
      Softsound, Ltd.
      See Also:
    • WAVE_FORMAT_RHETOREX_ADPCM

      protected static final int WAVE_FORMAT_RHETOREX_ADPCM
      Rhetorex Inc
      See Also:
    • WAVE_FORMAT_CREATIVE_ADPCM

      protected static final int WAVE_FORMAT_CREATIVE_ADPCM
      Creative Labs, Inc
      See Also:
    • WAVE_FORMAT_CREATIVE_FASTSPEECH8

      protected static final int WAVE_FORMAT_CREATIVE_FASTSPEECH8
      Creative Labs, Inc
      See Also:
    • WAVE_FORMAT_CREATIVE_FASTSPEECH10

      protected static final int WAVE_FORMAT_CREATIVE_FASTSPEECH10
      Creative Labs, Inc
      See Also:
    • WAVE_FORMAT_QUARTERDECK

      protected static final int WAVE_FORMAT_QUARTERDECK
      Quarterdeck Corporation
      See Also:
    • WAVE_FORMAT_FM_TOWNS_SND

      protected static final int WAVE_FORMAT_FM_TOWNS_SND
      Fujitsu Corp.
      See Also:
    • WAVE_FORMAT_BTV_DIGITAL

      protected static final int WAVE_FORMAT_BTV_DIGITAL
      Brooktree Corporation
      See Also:
    • WAVE_FORMAT_OLIGSM

      protected static final int WAVE_FORMAT_OLIGSM
      Ing C. Olivetti + C., S.p.A.
      See Also:
    • WAVE_FORMAT_OLIADPCM

      protected static final int WAVE_FORMAT_OLIADPCM
      Ing C. Olivetti + C., S.p.A.
      See Also:
    • WAVE_FORMAT_OLICELP

      protected static final int WAVE_FORMAT_OLICELP
      Ing C. Olivetti + C., S.p.A.
      See Also:
    • WAVE_FORMAT_OLISBC

      protected static final int WAVE_FORMAT_OLISBC
      Ing C. Olivetti + C., S.p.A.
      See Also:
    • WAVE_FORMAT_OLIOPR

      protected static final int WAVE_FORMAT_OLIOPR
      Ing C. Olivetti + C., S.p.A.
      See Also:
    • WAVE_FORMAT_LH_CODEC

      protected static final int WAVE_FORMAT_LH_CODEC
      Lernout + Hauspie
      See Also:
    • WAVE_FORMAT_NORRIS

      protected static final int WAVE_FORMAT_NORRIS
      Norris Communications, Inc.
      See Also:
    • WAVE_FORMAT_DEVELOPMENT

      protected static final int WAVE_FORMAT_DEVELOPMENT
      the WAVE_FORMAT_DEVELOPMENT format tag can be used during the development phase of a new wave format. Before shipping, you MUST acquire an official format tag from Microsoft.
      See Also:
  • Constructor Details

    • AudioTrack

      public AudioTrack(int trackIndex, int fourCC)
  • Method Details