1 /* 2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding 3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com 4 ** 5 ** This program is free software; you can redistribute it and/or modify 6 ** it under the terms of the GNU General Public License as published by 7 ** the Free Software Foundation; either version 2 of the License, or 8 ** (at your option) any later version. 9 ** 10 ** This program 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 13 ** GNU General Public License for more details. 14 ** 15 ** You should have received a copy of the GNU General Public License 16 ** along with this program; if not, write to the Free Software 17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 ** 19 ** Any non-GPL usage of this software or parts of this software is strictly 20 ** forbidden. 21 ** 22 ** Commercial non-GPL licensing of this software is possible. 23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. 24 ** 25 ** $Id: audio.h,v 1.9 2004/02/06 10:23:27 menno Exp $ 26 **/ 27 28 #ifndef AUDIO_H_INCLUDED 29 #define AUDIO_H_INCLUDED 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 #define MAXWAVESIZE 4294967040LU 36 37 #define OUTPUT_WAV 1 38 #define OUTPUT_RAW 2 39 40 typedef struct 41 { 42 int outputFormat; 43 FILE *sndfile; 44 unsigned int fileType; 45 unsigned long samplerate; 46 unsigned int bits_per_sample; 47 unsigned int channels; 48 unsigned long total_samples; 49 long channelMask; 50 } audio_file; 51 52 audio_file *open_audio_file(char *infile, int samplerate, int channels, 53 int outputFormat, int fileType, long channelMask); 54 int write_audio_file(audio_file *aufile, void *sample_buffer, int samples, int offset); 55 void close_audio_file(audio_file *aufile); 56 static int write_wav_header(audio_file *aufile); 57 static int write_wav_extensible_header(audio_file *aufile, long channelMask); 58 static int write_audio_16bit(audio_file *aufile, void *sample_buffer, 59 unsigned int samples); 60 static int write_audio_24bit(audio_file *aufile, void *sample_buffer, 61 unsigned int samples); 62 static int write_audio_32bit(audio_file *aufile, void *sample_buffer, 63 unsigned int samples); 64 static int write_audio_float(audio_file *aufile, void *sample_buffer, 65 unsigned int samples); 66 67 68 #ifdef __cplusplus 69 } 70 #endif 71 #endif 72