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

MixerStream is mixing the input from Multiple Input Streams. All streams must have the same audo format (sample rate, channels, bits per sample) More...

#include <AudioStreams.h>

Inheritance diagram for audio_tools::InputMixer< T >:
audio_tools::AudioStreamX audio_tools::AudioStream audio_tools::Stream audio_tools::AudioBaseInfoDependent audio_tools::AudioBaseInfoSource audio_tools::Print

Public Member Functions

void add (Stream &in, float weight=1.0)
 Adds a new input stream.
 
int available () override
 Provides the available bytes from the first stream with data. More...
 
virtual bool begin (AudioBaseInfo info)
 
void end ()
 Remove all input streams. More...
 
size_t readBytes (uint8_t *data, size_t len) override
 Provides the data from all streams mixed together. More...
 
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.
 
- Public Member Functions inherited from audio_tools::AudioStreamX
 AudioStreamX (AudioStreamX const &)=delete
 
virtual int available () override
 
AudioStreamXoperator= (AudioStreamX const &)=delete
 
virtual int peek () override
 
virtual int read () override
 
virtual size_t readBytes (uint8_t *buffer, size_t length) override
 
virtual size_t write (const uint8_t *buffer, size_t size) override
 
virtual size_t write (uint8_t) override
 
- Public Member Functions inherited from audio_tools::AudioStream
 AudioStream (AudioStream const &)=delete
 
virtual AudioBaseInfo audioInfo () override
 
virtual int availableForWrite () override
 
virtual bool begin ()
 
virtual void end ()
 
virtual void flush () override
 
 operator bool ()
 
AudioStreamoperator= (AudioStream const &)=delete
 
virtual size_t readBytes (char *buffer, size_t length)
 
virtual size_t readBytes (uint8_t *buffer, size_t length) STREAM_WRITE_OVERRIDE=0
 
virtual void setAudioInfo (AudioBaseInfo info) override
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi) override
 
virtual StreamtoStreamPointer ()
 
virtual size_t write (const uint8_t *buffer, size_t size) override=0
 
- Public Member Functions inherited from audio_tools::Stream
virtual int available ()
 
virtual int peek ()
 
virtual int read ()
 
virtual size_t readBytes (uint8_t *buffer, size_t len)
 
virtual void setTimeout (size_t t)
 
- Public Member Functions inherited from audio_tools::Print
virtual int availableForWrite ()
 
virtual void flush ()
 
virtual int print (char c, PrintCharFmt spec)
 
virtual int print (const char *msg)
 
virtual int print (int number)
 
virtual int println (const char *msg="")
 
virtual size_t write (const char *buffer, size_t size)
 
virtual size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
virtual size_t write (uint8_t ch)
 
- Public Member Functions inherited from audio_tools::AudioBaseInfoDependent
virtual AudioBaseInfo audioInfo ()=0
 
virtual void setAudioInfo (AudioBaseInfo info)=0
 
virtual bool validate (AudioBaseInfo &info)
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi)=0
 

Protected Attributes

Vector< uint8_t > buffer {DEFAULT_BUFFER_SIZE}
 
Vector< Stream * > streams {10}
 
float total_weights = 0.0
 
Vector< float > weights {10}
 
- Protected Attributes inherited from audio_tools::AudioStream
AudioBaseInfo info
 
AudioBaseInfoDependentp_notify =nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from audio_tools::AudioStream
virtual int not_supported (int out)
 

Detailed Description

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

MixerStream is mixing the input from Multiple Input Streams. All streams must have the same audo format (sample rate, channels, bits per sample)

Author
Phil Schatzmann

Member Function Documentation

◆ available()

template<typename T >
int audio_tools::InputMixer< T >::available ( )
inlineoverridevirtual

Provides the available bytes from the first stream with data.

Reimplemented from audio_tools::AudioStreamX.

◆ end()

template<typename T >
void audio_tools::InputMixer< T >::end ( )
inlinevirtual

Remove all input streams.

Reimplemented from audio_tools::AudioStream.

◆ readBytes()

template<typename T >
size_t audio_tools::InputMixer< T >::readBytes ( uint8_t *  data,
size_t  len 
)
inlineoverridevirtual

Provides the data from all streams mixed together.

Reimplemented from audio_tools::AudioStreamX.


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