3 Copyright (C) 2000-2001, Silicon Graphics, Inc.
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307 USA.
24 This file contains the file format units.
31 #include "audiofile.h"
32 #include "afinternal.h"
44 #include "compression.h"
46 #include "modules/pcm.h"
47 #include "modules/g711.h"
48 #include "modules/ima.h"
49 #include "modules/msadpcm.h"
51 extern _InstParamInfo _af_aiff_inst_params
[];
52 extern _InstParamInfo _af_wave_inst_params
[];
54 extern int _af_raw_compression_types
[];
55 extern int _af_aiffc_compression_types
[];
56 extern int _af_next_compression_types
[];
57 extern int _af_wave_compression_types
[];
59 const _Unit _af_units
[_AF_NUM_UNITS
] =
63 "Raw Data", "Raw Sound Data", "raw",
64 true, NULL
, _af_raw_complete_setup
,
65 {_af_raw_recognize
, _af_raw_read_init
},
66 {_af_raw_write_init
, NULL
, NULL
},
67 AF_SAMPFMT_TWOSCOMP
, 16,
68 _AF_RAW_NUM_COMPTYPES
,
69 _af_raw_compression_types
,
70 0, /* maximum marker count */
71 0, /* maximum instrument count */
72 0, /* maxium number of loops per instrument */
77 "AIFF-C", "AIFF-C File Format", "aifc",
78 true, _af_aifc_get_version
, _af_aiff_complete_setup
,
79 {_af_aifc_recognize
, _af_aiff_read_init
},
80 {_af_aiff_write_init
, _af_aiff_instparam_valid
, _af_aiff_update
},
81 AF_SAMPFMT_TWOSCOMP
, 16,
82 _AF_AIFFC_NUM_COMPTYPES
,
83 _af_aiffc_compression_types
,
84 65535, /* maximum marker count */
85 1, /* maximum instrument count */
86 2, /* maximum number of loops per instrument */
87 _AF_AIFF_NUM_INSTPARAMS
,
92 "AIFF", "Audio Interchange File Format", "aiff",
93 true, NULL
, _af_aiff_complete_setup
,
94 {_af_aiff_recognize
, _af_aiff_read_init
},
95 {_af_aiff_write_init
, _af_aiff_instparam_valid
, _af_aiff_update
},
96 AF_SAMPFMT_TWOSCOMP
, 16,
97 0, /* supported compression types */
99 65535, /* maximum marker count */
100 1, /* maximum instrument count */
101 2, /* maximum number of loops per instrument */
102 _AF_AIFF_NUM_INSTPARAMS
,
107 "NeXT .snd/Sun .au", "NeXT .snd/Sun .au Format", "next",
108 true, NULL
, _af_next_complete_setup
,
109 {_af_next_recognize
, _af_next_read_init
},
110 {_af_next_write_init
, NULL
, _af_next_update
},
111 AF_SAMPFMT_TWOSCOMP
, 16,
112 _AF_NEXT_NUM_COMPTYPES
,
113 _af_next_compression_types
,
114 0, /* maximum marker count */
115 0, /* maximum instrument count */
116 0, /* maximum number of loops per instrument */
121 "MS RIFF WAVE", "Microsoft RIFF WAVE Format", "wave",
122 true, NULL
, _af_wave_complete_setup
,
123 {_af_wave_recognize
, _af_wave_read_init
},
124 {_af_wave_write_init
, _af_wave_instparam_valid
, _af_wave_update
},
125 AF_SAMPFMT_TWOSCOMP
, 16,
126 _AF_WAVE_NUM_COMPTYPES
,
127 _af_wave_compression_types
,
128 AF_NUM_UNLIMITED
, /* maximum marker count */
129 1, /* maximum instrument count */
130 AF_NUM_UNLIMITED
, /* maximum number of loops per instrument */
131 _AF_WAVE_NUM_INSTPARAMS
,
136 "BICSF", "Berkeley/IRCAM/CARL Sound Format", "bicsf",
137 true, NULL
, _af_ircam_complete_setup
,
138 {_af_ircam_recognize
, _af_ircam_read_init
},
139 {_af_ircam_write_init
, NULL
, _af_ircam_update
},
140 AF_SAMPFMT_TWOSCOMP
, 16,
141 0, /* number of compression types */
142 NULL
, /* compression types */
143 0, /* maximum marker count */
144 0, /* maximum instrument count */
145 0, /* maximum number of loops per instrument */
146 0, /* number of instrument parameters */
147 NULL
/* instrument parameters */
150 AF_FILE_MPEG1BITSTREAM
,
151 "MPEG", "MPEG Audio Bitstream", "mpeg",
155 AF_FILE_SOUNDDESIGNER1
,
156 "Sound Designer 1", "Sound Designer 1 File Format", "sd1",
160 AF_FILE_SOUNDDESIGNER2
,
161 "Sound Designer 2", "Sound Designer 2 File Format", "sd2",
166 "AVR", "Audio Visual Research File Format", "avr",
167 true, NULL
, _af_avr_complete_setup
,
168 {_af_avr_recognize
, _af_avr_read_init
},
169 {_af_avr_write_init
, NULL
, _af_avr_update
},
170 AF_SAMPFMT_TWOSCOMP
, 16,
171 0, /* number of compression types */
172 NULL
, /* compression types */
173 0, /* maximum marker count */
174 0, /* maximum instrument count */
175 0, /* maximum number of loops per instrument */
176 0, /* number of instrument parameters */
180 "IFF/8SVX", "Amiga IFF/8SVX Sound File Format", "iff",
181 true, NULL
, _af_iff_complete_setup
,
182 {_af_iff_recognize
, _af_iff_read_init
},
183 {_af_iff_write_init
, NULL
, _af_iff_update
},
184 AF_SAMPFMT_TWOSCOMP
, 8,
185 0, /* number of compression types */
186 NULL
, /* compression types */
187 0, /* maximum marker count */
188 0, /* maximum instrument count */
189 0, /* maximum number of loops per instrument */
190 0, /* number of instrument parameters */
193 AF_FILE_SAMPLEVISION
,
194 "Sample Vision", "Sample Vision File Format", "smp",
199 "VOC", "Creative Voice File Format", "voc",
204 "NIST SPHERE", "NIST SPHERE File Format", "nist",
205 true, NULL
, _af_nist_complete_setup
,
206 {_af_nist_recognize
, _af_nist_read_init
},
207 {_af_nist_write_init
, NULL
, _af_nist_update
},
208 AF_SAMPFMT_TWOSCOMP
, 16,
209 0, /* number of compression types */
210 NULL
, /* compression types */
211 0, /* maximum marker count */
212 0, /* maximum instrument count */
213 0, /* maximum number of loops per instrument */
214 0, /* number of instrument parameters */
215 NULL
/* instrument parameters */
219 "SoundFont 2", "SoundFont 2 File Format", "sf2",
224 const _CompressionUnit _af_compression
[_AF_NUM_COMPRESSION
] =
230 "none", /* short name */
233 AF_SAMPFMT_TWOSCOMP
, 16,
234 false, /* needsRebuffer */
235 false, /* multiple_of */
237 _AFpcminitcompress
, _AFpcminitdecompress
240 AF_COMPRESSION_G711_ULAW
,
243 "CCITT G.711 u-law", /* shortname */
246 AF_SAMPFMT_TWOSCOMP
, 16,
247 false, /* needsRebuffer */
248 false, /* multiple_of */
250 _AFg711initcompress
, _AFg711initdecompress
253 AF_COMPRESSION_G711_ALAW
,
256 "CCITT G.711 A-law", /* short name */
259 AF_SAMPFMT_TWOSCOMP
, 16,
260 false, /* needsRebuffer */
261 false, /* multiple_of */
263 _AFg711initcompress
, _AFg711initdecompress
269 "IMA ADPCM", /* short name */
272 AF_SAMPFMT_TWOSCOMP
, 16,
273 true, /* needsRebuffer */
274 false, /* multiple_of */
275 _af_ima_adpcm_format_ok
,
276 NULL
, _af_ima_adpcm_init_decompress
279 AF_COMPRESSION_MS_ADPCM
,
281 "msadpcm", /* label */
282 "MS ADPCM", /* short name */
285 AF_SAMPFMT_TWOSCOMP
, 16,
286 true, /* needsRebuffer */
287 false, /* multiple_of */
288 _af_ms_adpcm_format_ok
,
289 NULL
, _af_ms_adpcm_init_decompress