arduino-audio-tools
Loading...
Searching...
No Matches
ChannelAvg Class Reference

We average pairs of channels in a datastream. E.g. if we have 4 channels we end up with 2 channels. The channels will be (channel_1 + channel_2)/2 (channel_3 - channel_4)/2. This is equivalent of stereo to mono conversion but will also work for quadric, sexic or octic audio. This will not work if you provide single channel data! More...

#include <CodecOpusOgg.h>

Inheritance diagram for ChannelAvg:
BaseConverter BaseConverter

Public Member Functions

 ChannelAvg ()=default
 ChannelAvg ()=default
 ChannelAvg (int bitsPerSample)
 ChannelAvg (int bitsPerSample)
size_t convert (uint8_t *src, size_t size)
size_t convert (uint8_t *src, size_t size)
size_t convert (uint8_t *target, uint8_t *src, size_t size)
size_t convert (uint8_t *target, uint8_t *src, size_t size)
void setBits (int bits)
void setBits (int bits)

Protected Attributes

int bits = 16

Detailed Description

We average pairs of channels in a datastream. E.g. if we have 4 channels we end up with 2 channels. The channels will be (channel_1 + channel_2)/2 (channel_3 - channel_4)/2. This is equivalent of stereo to mono conversion but will also work for quadric, sexic or octic audio. This will not work if you provide single channel data!

Author
Urs Utzinger

Constructor & Destructor Documentation

◆ ChannelAvg() [1/4]

ChannelAvg ( )
default

◆ ChannelAvg() [2/4]

ChannelAvg ( int bitsPerSample)
inline

◆ ChannelAvg() [3/4]

ChannelAvg ( )
default

◆ ChannelAvg() [4/4]

ChannelAvg ( int bitsPerSample)
inline

Member Function Documentation

◆ convert() [1/4]

size_t convert ( uint8_t * src,
size_t size )
inlinevirtual

Implements BaseConverter.

◆ convert() [2/4]

size_t convert ( uint8_t * src,
size_t size )
inlinevirtual

Implements BaseConverter.

◆ convert() [3/4]

size_t convert ( uint8_t * target,
uint8_t * src,
size_t size )
inline

◆ convert() [4/4]

size_t convert ( uint8_t * target,
uint8_t * src,
size_t size )
inline

◆ setBits() [1/2]

void setBits ( int bits)
inline

◆ setBits() [2/2]

void setBits ( int bits)
inline

Member Data Documentation

◆ bits

int bits = 16
protected

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