00001 /*************************************************************************** 00002 * Copyright (C) 2010 by Matthias Ihrke * 00003 * ihrke@nld.ds.mpg.de 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * aint with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00035 #ifndef IO_WAV_H 00036 # define IO_WAV_H 00037 00038 #include <stdint.h> 00039 #include <stdio.h> 00040 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00045 00046 typedef struct wavfile_t { 00047 uint16_t numchannels; 00048 uint32_t samplerate; 00049 uint32_t byterate; 00050 uint16_t blockalign; 00053 uint16_t bits_per_sample; 00054 00055 uint32_t data_size; 00057 void *data; 00061 } WavFile; 00062 00063 /* -------------- FUNCTIONS ---------------- */ 00064 00065 WavFile* wavfile_read ( FILE *f ); 00066 int wavfile_write( WavFile *w, const char *fname ); 00067 00068 void wavfile_print( FILE *out, WavFile *w ); 00069 void wavfile_free ( WavFile *w ); 00070 00071 #ifdef __cplusplus 00072 } 00073 #endif 00074 00075 #endif /* IO_WAV_H */