TinyModem
Header-only software audio modem library
Loading...
Searching...
No Matches
tinymodem::SampleOutput Class Reference

Writes float samples (-1.0 to 1.0) as 16 bit PCM with the requested number of channels and volume to a Print. More...

#include <ModemBase.h>

Public Member Functions

void setOutput (Print &out)
void begin (int channels, float volume)
void write (float sample)
 Writes a sample to all channels.
void flush ()
 Writes the buffered samples.

Protected Attributes

Print * p_print = nullptr
int16_t buffer [BUFFER_SIZE]
int idx = 0
int channels = 1
int32_t gain = 32767

Static Protected Attributes

static constexpr int BUFFER_SIZE = 128

Detailed Description

Writes float samples (-1.0 to 1.0) as 16 bit PCM with the requested number of channels and volume to a Print.

Member Function Documentation

◆ begin()

void tinymodem::SampleOutput::begin ( int channels,
float volume )
inline

◆ flush()

void tinymodem::SampleOutput::flush ( )
inline

Writes the buffered samples.

◆ setOutput()

void tinymodem::SampleOutput::setOutput ( Print & out)
inline

◆ write()

void tinymodem::SampleOutput::write ( float sample)
inline

Writes a sample to all channels.

Member Data Documentation

◆ buffer

int16_t tinymodem::SampleOutput::buffer[BUFFER_SIZE]
protected

◆ BUFFER_SIZE

int tinymodem::SampleOutput::BUFFER_SIZE = 128
staticconstexprprotected

◆ channels

int tinymodem::SampleOutput::channels = 1
protected

◆ gain

int32_t tinymodem::SampleOutput::gain = 32767
protected

◆ idx

int tinymodem::SampleOutput::idx = 0
protected

◆ p_print

Print* tinymodem::SampleOutput::p_print = nullptr
protected

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