00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2008 Free Software Foundation, Inc. 00004 * 00005 * This file is part of GNU Radio 00006 * 00007 * GNU Radio is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 3, or (at your option) 00010 * any later version. 00011 * 00012 * GNU Radio is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with GNU Radio; see the file COPYING. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, 00020 * Boston, MA 02110-1301, USA. 00021 */ 00022 00023 // This file stores all the RIFF file type knowledge for the gr_wavfile_* 00024 // blocks. 00025 00026 #include <cstdio> 00027 00048 bool 00049 gri_wavheader_parse(FILE *fp, 00050 unsigned int &sample_rate, 00051 int &nchans, 00052 int &bytes_per_sample, 00053 int &first_sample_pos, 00054 unsigned int &samples_per_chan); 00055 00056 00062 short int 00063 gri_wav_read_sample(FILE *fp, int bytes_per_sample); 00064 00065 00073 bool 00074 gri_wavheader_write(FILE *fp, 00075 unsigned int sample_rate, 00076 int nchans, 00077 int bytes_per_sample); 00078 00084 void 00085 gri_wav_write_sample(FILE *fp, short int sample, int bytes_per_sample); 00086 00087 00099 bool 00100 gri_wavheader_complete(FILE *fp, unsigned int byte_count);