GNU Radio 3.5.3.2 C++ API
gr_wavfile_sink Class Reference

Write stream to a Microsoft PCM (.wav) file. More...

#include <gr_wavfile_sink.h>

Inheritance diagram for gr_wavfile_sink:

List of all members.

Public Member Functions

 ~gr_wavfile_sink ()
bool open (const char *filename)
 Opens a new file and writes a WAV header. Thread-safe.
void close ()
 Closes the currently active file and completes the WAV header. Thread-safe.
void do_update ()
 If any file changes have occurred, update now. This is called internally by work() and thus doesn't usually need to be called by hand.
void set_sample_rate (unsigned int sample_rate)
 Set the sample rate. This will not affect the WAV file currently opened. Any following open() calls will use this new sample rate.
void set_bits_per_sample (int bits_per_sample)
 Set bits per sample. This will not affect the WAV file currently opened (see set_sample_rate()). If the value is neither 8 nor 16, the call is ignored and the current value is kept.
int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 just like gr_block::general_work, only this arranges to call consume_each for you

Friends

GR_CORE_API gr_wavfile_sink_sptr gr_make_wavfile_sink (const char *filename, int n_channels, unsigned int sample_rate, int bits_per_sample)

Detailed Description

Write stream to a Microsoft PCM (.wav) file.

Values must be floats within [-1;1]. Check gr_make_wavfile_sink() for extra info.


Constructor & Destructor Documentation

gr_wavfile_sink::~gr_wavfile_sink ( )

Member Function Documentation

void gr_wavfile_sink::close ( )

Closes the currently active file and completes the WAV header. Thread-safe.

void gr_wavfile_sink::do_update ( )

If any file changes have occurred, update now. This is called internally by work() and thus doesn't usually need to be called by hand.

bool gr_wavfile_sink::open ( const char *  filename)

Opens a new file and writes a WAV header. Thread-safe.

void gr_wavfile_sink::set_bits_per_sample ( int  bits_per_sample)

Set bits per sample. This will not affect the WAV file currently opened (see set_sample_rate()). If the value is neither 8 nor 16, the call is ignored and the current value is kept.

void gr_wavfile_sink::set_sample_rate ( unsigned int  sample_rate)

Set the sample rate. This will not affect the WAV file currently opened. Any following open() calls will use this new sample rate.

int gr_wavfile_sink::work ( int  noutput_items,
gr_vector_const_void_star input_items,
gr_vector_void_star output_items 
) [virtual]

just like gr_block::general_work, only this arranges to call consume_each for you

The user must override work to define the signal processing code

Implements gr_sync_block.


Friends And Related Function Documentation

GR_CORE_API gr_wavfile_sink_sptr gr_make_wavfile_sink ( const char *  filename,
int  n_channels,
unsigned int  sample_rate,
int  bits_per_sample 
) [friend]

The documentation for this class was generated from the following file: