arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::OutputMixer< T > Class Template Reference

Mixing of multiple outputs to one final output. More...

#include <AudioPrint.h>

Inheritance diagram for audio_tools::OutputMixer< T >:
Print

Public Member Functions

 OutputMixer (Print &finalOutput, int outputStreamCount)
 
int availableForWrite () override
 Provides the bytes available to write for the current stream buffer. More...
 
int availableForWrite (int idx)
 Provides the bytes available to write for the indicated stream index.
 
void begin (int copy_buffer_size_bytes=DEFAULT_BUFFER_SIZE, MemoryType memoryType=PS_RAM)
 
void end ()
 Remove all input streams.
 
void flushMixer ()
 Force output to final destination.
 
void setOutputCount (int count)
 
void setWeight (int channel, float weight)
 Defines a new weight for the indicated channel: If you set it to 0 it is muted.
 
int size ()
 Number of stremams to which are mixed together.
 
size_t write (const uint8_t *buffer_c, size_t bytes) override
 Write the data from a simgle stream which will be mixed together (the stream idx is increased) More...
 
size_t write (int idx, const uint8_t *buffer_c, size_t bytes)
 Write the data for an individual stream idx which will be mixed together.
 
size_t write (uint8_t) override
 
- Public Member Functions inherited from Print
virtual int availableForWrite ()
 
void clearWriteError ()
 
virtual void flush ()
 
int getWriteError ()
 
size_t print (char)
 
size_t print (const __FlashStringHelper *)
 
size_t print (const char[])
 
size_t print (const Printable &)
 
size_t print (const String &)
 
size_t print (double, int=2)
 
size_t print (int, int=DEC)
 
size_t print (long long, int=DEC)
 
size_t print (long, int=DEC)
 
size_t print (unsigned char, int=DEC)
 
size_t print (unsigned int, int=DEC)
 
size_t print (unsigned long long, int=DEC)
 
size_t print (unsigned long, int=DEC)
 
size_t println (char)
 
size_t println (const __FlashStringHelper *)
 
size_t println (const char[])
 
size_t println (const Printable &)
 
size_t println (const String &s)
 
size_t println (double, int=2)
 
size_t println (int, int=DEC)
 
size_t println (long long, int=DEC)
 
size_t println (long, int=DEC)
 
size_t println (unsigned char, int=DEC)
 
size_t println (unsigned int, int=DEC)
 
size_t println (unsigned long long, int=DEC)
 
size_t println (unsigned long, int=DEC)
 
size_t println (void)
 
size_t write (const char *buffer, size_t size)
 
size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
virtual size_t write (uint8_t)=0
 

Protected Member Functions

void allocate_buffers ()
 
void free_buffers ()
 
void update_total_weights ()
 
- Protected Member Functions inherited from Print
void setWriteError (int err=1)
 

Protected Attributes

Vector< RingBuffer< T > * > buffers {0}
 
bool is_active = false
 
MemoryType memory_type
 
Vector< T > output {0}
 
int output_count
 
Printp_final_output =nullptr
 
void * p_memory =nullptr
 
int size_bytes
 
int stream_idx = 0
 
float total_weights = 0.0
 
Vector< float > weights {0}
 

Detailed Description

template<typename T>
class audio_tools::OutputMixer< T >

Mixing of multiple outputs to one final output.

Author
Phil Schatzmann
Template Parameters
T

Member Function Documentation

◆ availableForWrite()

template<typename T >
int audio_tools::OutputMixer< T >::availableForWrite ( )
inlineoverridevirtual

Provides the bytes available to write for the current stream buffer.

Reimplemented from Print.

◆ write() [1/2]

template<typename T >
size_t audio_tools::OutputMixer< T >::write ( const uint8_t *  buffer_c,
size_t  bytes 
)
inlineoverridevirtual

Write the data from a simgle stream which will be mixed together (the stream idx is increased)

Reimplemented from Print.

◆ write() [2/2]

template<typename T >
size_t audio_tools::OutputMixer< T >::write ( uint8_t  )
inlineoverridevirtual

Implements Print.


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