diff options
Diffstat (limited to 'gr-blocks/include/gnuradio/blocks/wavfile.h')
-rw-r--r-- | gr-blocks/include/gnuradio/blocks/wavfile.h | 121 |
1 files changed, 59 insertions, 62 deletions
diff --git a/gr-blocks/include/gnuradio/blocks/wavfile.h b/gr-blocks/include/gnuradio/blocks/wavfile.h index 2c03319c4a..caf06532c3 100644 --- a/gr-blocks/include/gnuradio/blocks/wavfile.h +++ b/gr-blocks/include/gnuradio/blocks/wavfile.h @@ -30,76 +30,73 @@ #include <cstdio> namespace gr { - namespace blocks { +namespace blocks { - /*! - * \brief Read signal information from a given WAV file. - * - * \param[in] fp File pointer to an opened, empty file. - * \param[out] sample_rate Stores the sample rate [S/s] - * \param[out] nchans Number of channels - * \param[out] bytes_per_sample Bytes per sample, can either be 1 or 2 (corresponding o - * 8 or 16 bit samples, respectively) - * \param[out] first_sample_pos Number of the first byte containing a sample. Use this - * with fseek() to jump from the end of the file to the - * first sample when in repeat mode. - * \param[out] samples_per_chan Number of samples per channel - * \return True on a successful read, false if the file could not be read or is - * not a valid WAV file. - */ - BLOCKS_API bool wavheader_parse(FILE *fp, - unsigned int &sample_rate, - int &nchans, - int &bytes_per_sample, - int &first_sample_pos, - unsigned int &samples_per_chan); +/*! + * \brief Read signal information from a given WAV file. + * + * \param[in] fp File pointer to an opened, empty file. + * \param[out] sample_rate Stores the sample rate [S/s] + * \param[out] nchans Number of channels + * \param[out] bytes_per_sample Bytes per sample, can either be 1 or 2 (corresponding o + * 8 or 16 bit samples, respectively) + * \param[out] first_sample_pos Number of the first byte containing a sample. Use this + * with fseek() to jump from the end of the file to the + * first sample when in repeat mode. + * \param[out] samples_per_chan Number of samples per channel + * \return True on a successful read, false if the file could not be read or is + * not a valid WAV file. + */ +BLOCKS_API bool wavheader_parse(FILE* fp, + unsigned int& sample_rate, + int& nchans, + int& bytes_per_sample, + int& first_sample_pos, + unsigned int& samples_per_chan); - /*! - * \brief Read one sample from an open WAV file at the current position. - * - * \details - * Takes care of endianness. - */ - BLOCKS_API short int wav_read_sample(FILE *fp, int bytes_per_sample); +/*! + * \brief Read one sample from an open WAV file at the current position. + * + * \details + * Takes care of endianness. + */ +BLOCKS_API short int wav_read_sample(FILE* fp, int bytes_per_sample); - /*! - * \brief Write a valid RIFF file header - * - * Note: Some header values are kept blank because they're usually - * not known a-priori (file and chunk lengths). Use - * gri_wavheader_complete() to fill these in. - */ - BLOCKS_API bool wavheader_write(FILE *fp, - unsigned int sample_rate, - int nchans, - int bytes_per_sample); +/*! + * \brief Write a valid RIFF file header + * + * Note: Some header values are kept blank because they're usually + * not known a-priori (file and chunk lengths). Use + * gri_wavheader_complete() to fill these in. + */ +BLOCKS_API bool +wavheader_write(FILE* fp, unsigned int sample_rate, int nchans, int bytes_per_sample); - /*! - * \brief Write one sample to an open WAV file at the current position. - * - * \details - * Takes care of endianness. - */ - BLOCKS_API void wav_write_sample(FILE *fp, short int sample, int bytes_per_sample); +/*! + * \brief Write one sample to an open WAV file at the current position. + * + * \details + * Takes care of endianness. + */ +BLOCKS_API void wav_write_sample(FILE* fp, short int sample, int bytes_per_sample); - /*! - * \brief Complete a WAV header - * - * \details - * Note: The stream position is changed during this function. If - * anything needs to be written to the WAV file after calling this - * function (which shouldn't happen), you need to fseek() to the - * end of the file (or wherever). - * - * \param[in] fp File pointer to an open WAV file with a blank header - * \param[in] byte_count Length of all samples written to the file in bytes. - */ - BLOCKS_API bool wavheader_complete(FILE *fp, unsigned int byte_count); +/*! + * \brief Complete a WAV header + * + * \details + * Note: The stream position is changed during this function. If + * anything needs to be written to the WAV file after calling this + * function (which shouldn't happen), you need to fseek() to the + * end of the file (or wherever). + * + * \param[in] fp File pointer to an open WAV file with a blank header + * \param[in] byte_count Length of all samples written to the file in bytes. + */ +BLOCKS_API bool wavheader_complete(FILE* fp, unsigned int byte_count); - } /* namespace blocks */ +} /* namespace blocks */ } /* namespace gr */ #endif /* _GR_WAVFILE_H_ */ - |