class RechannelEffect

Defined at line 21 of file ../../src/media/audio/examples/effects/rechannel_effect.h

RechannelEffect: an example of non-in-place effect with no controls. Being non-

inplace, it has channel restrictions: specifically it must take in six

channels and produce two channels. It does so while adding no latency.

Public Members

static const uint16_t kNumChannelsIn
static const uint16_t kNumChannelsOut
static const uint32_t kLatencyFrames
static const size_t kOutputBufferSizeFrames

Public Methods

bool GetInfo (fuchsia_audio_effects_description * desc)

Defined at line 28 of file ../../src/media/audio/examples/effects/rechannel_effect.h

RechannelEffect * Create (uint32_t frame_rate, uint16_t channels_in, uint16_t channels_out, std::string_view )

Defined at line 35 of file ../../src/media/audio/examples/effects/rechannel_effect.h

void RechannelEffect (uint32_t frame_rate)

Defined at line 42 of file ../../src/media/audio/examples/effects/rechannel_effect.h

bool Process (uint32_t num_frames, const float * buff_in, float ** output)

Effect converts a 5.1 mix into stereo.

Left = FL + FC*sqr(.5) + BL -and- Right = FR + FC*sqr(.5) + BR

To normalize: div by (1+.7071+1) or *= .36939806251812928

Note: LFE is omitted (common practice in stereo downmixes).

Or, with dpl encoding:

Left = FL + FC*sqr(.5) + BL*sqr(.75) + BR*sqr(.25)

Right = FR + FC*sqr(.5) - BL*sqr(.25) - BR*sqr(.75)

To normalize: div by (1+.7071+.8660+.5) or *= .32540090689572506

Defined at line 56 of file ../../src/media/audio/examples/effects/rechannel_effect.h