sdr::WavSink< Scalar > Class Template Reference
Data sinks.

Stores the received buffers into a WAV file. More...

`#include <wavfile.hh>`

Inheritance diagram for sdr::WavSink< Scalar >:

## Public Member Functions

| WavSink (const std::string &filename)
| Constructor, `filename` specifies the file name, the WAV data is stored into. More...
virtual | ~WavSink ()
| Destructor, closes the file if not done yet. More...
virtual void | config (const Config &src_cfg)
| Configures the sink. More...
void | close ()
| Completes the WAV header and closes the file. More...
virtual void | process (const Buffer< Scalar > &buffer, bool allow_overwrite)
| Writes some data into the WAV file. More...
Public Member Functions inherited from sdr::Sink< Scalar >
| Sink ()
| Constructor. More...
virtual | ~Sink ()
| Drestructor. More...
virtual void | handleBuffer (const RawBuffer &buffer, bool allow_overwrite)
| Re-implemented from `SinkBase`. More...
Public Member Functions inherited from sdr::SinkBase
| SinkBase ()
| Constructor. More...
virtual | ~SinkBase ()
| Destructor. More...

## Protected Attributes

std::fstream | _file
| The file output stream. More...
uint16_t | _bitsPerSample
| The number of bits per sample (depends on the template type). More...
uint32_t | _frameCount
| The total number of frame counts. More...
uint32_t | _sampleRate
| The sample rate. More...
uint16_t | _numChanels
| The number of chanels. More...

## Detailed Description

### template<class Scalar>
class sdr::WavSink< Scalar >

Stores the received buffers into a WAV file.

## Constructor & Destructor Documentation

template<class Scalar >

sdr::WavSink< Scalar >::WavSink | ( | const std::string & | filename | ) |

inline

Constructor, `filename` specifies the file name, the WAV data is stored into.

Exceptions

  ConfigError | If the specified file can not be opened for output.

template<class Scalar >

virtual sdr::WavSink< Scalar >::~WavSink | ( |  | ) |

inlinevirtual

Destructor, closes the file if not done yet.

## Member Function Documentation

template<class Scalar >

void sdr::WavSink< Scalar >::close | ( |  | ) |

inline

Completes the WAV header and closes the file.

template<class Scalar >

virtual void sdr::WavSink< Scalar >::config | ( | const Config & | src_cfg | ) |

inlinevirtual

Configures the sink.

Implements sdr::SinkBase.

template<class Scalar >

virtual void sdr::WavSink< Scalar >::process | ( | const Buffer< Scalar > & | buffer,
|  | bool | allow_overwrite
| ) |  |

inlinevirtual

Writes some data into the WAV file.

Implements sdr::Sink< Scalar >.

## Member Data Documentation

template<class Scalar >

uint16_t sdr::WavSink< Scalar >::_bitsPerSample

protected

The number of bits per sample (depends on the template type).

template<class Scalar >

std::fstream sdr::WavSink< Scalar >::_file

protected

The file output stream.

template<class Scalar >

uint32_t sdr::WavSink< Scalar >::_frameCount

protected

The total number of frame counts.

template<class Scalar >

uint16_t sdr::WavSink< Scalar >::_numChanels

protected

The number of chanels.

template<class Scalar >

uint32_t sdr::WavSink< Scalar >::_sampleRate

protected

The sample rate.

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

- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/wavfile.hh