summaryrefslogtreecommitdiff
path: root/packages/fcl-sound/src/fpwavformat.pas
blob: 7ed312e826c23a8b4a412b09641d368ffadd02d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{*****************************************************************************}
{
    This file is part of the Free Pascal's "Free Components Library".
    Copyright (c) 2014 by Mazen NEIFER of the Free Pascal development team
    and was adapted from wavopenal.pas copyright (c) 2010 Dmitry Boyarintsev.

    RIFF/WAVE sound file basic types and constants.

    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
}
unit fpwavformat;

{$mode objfpc}{$H+}

interface

const
  AUDIO_CHUNK_ID_RIFF = 'RIFF';
  AUDIO_CHUNK_ID_WAVE = 'WAVE';
  AUDIO_CHUNK_ID_fmt  = 'fmt ';
  AUDIO_CHUNK_ID_data = 'data';
  AUDIO_FORMAT_PCM = 1;

type
  TChunkID = array [0..3] of char;
  TChunkHeader = packed record
    ID: TChunkID;
    Size: UInt32;
  end;
  TRiffHeader = packed record
    ChunkHeader: TChunkHeader;
    Format: TChunkID;
  end;
  TWaveFormat = packed record
    ChunkHeader: TChunkHeader;
    Format: UInt16;
    Channels: UInt16;
    SampleRate: UInt32;
    ByteRate: UInt32;
    BlockAlign: UInt16;
    BitsPerSample: UInt16;
  end;

implementation

end.