1 /* 2 * FAAC - Freeware Advanced Audio Coder 3 * Copyright (C) 2002 Krzysztof Nikiel 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 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 * Lesser General Public License for more details. 14 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * 19 * $Id: input.h,v 1.7 2008/11/24 22:00:11 menno Exp $ 20 */ 21 22 #ifndef _INPUT_H 23 #define _INPUT_H 24 25 #ifdef HAVE_CONFIG_H 26 #include "config.h" 27 #endif 28 29 #include <stdio.h> 30 #include <stdlib.h> 31 #ifdef HAVE_SYS_TYPES_H 32 # include <sys/types.h> 33 #endif 34 #include <stdint.h> 35 36 #ifdef __cplusplus 37 extern "C" 38 { 39 #endif 40 41 typedef struct 42 { 43 FILE *f; 44 int channels; 45 int samplebytes; 46 int samplerate; 47 int samples; 48 int bigendian; 49 int isfloat; 50 } pcmfile_t; 51 52 pcmfile_t *wav_open_read(const char *path, int rawchans); 53 size_t wav_read_float32(pcmfile_t *sndf, float *buf, size_t num, int *map); 54 size_t wav_read_int24(pcmfile_t *sndf, int32_t *buf, size_t num, int *map); 55 int wav_close(pcmfile_t *file); 56 57 #ifdef __cplusplus 58 } 59 #endif 60 #endif /* _INPUT_H */ 61