class DelayEffect

Defined at line 26 of file ../../src/media/audio/examples/effects/delay_effect.h

DelayEffect: example of inplace effect with one control. Channels_in must always

equal channels_out, but it has no further restriction. This effect delays all

channels by a constant number of frames (specified by the control setting).

This effect INTENTIONALLY adds a delay which clock-synchronization mechanisms

should NOT try to compensate for; in fact it adds zero "unwanted" latency.

Public Members

static const uint16_t kNumChannelsIn
static const uint16_t kNumChannelsOut
static const uint32_t kLatencyFrames
static const uint32_t kMaxDelayFrames
static const uint32_t kMinDelayFrames

Protected Members

uint32_t delay_samples_
unique_ptr delay_buff_

Public Methods

void ~DelayEffect ()

Defined at line 41 of file ../../src/media/audio/examples/effects/delay_effect.h

bool GetInfo (fuchsia_audio_effects_description * desc)

static -- called from static EffectBase::GetInfo; uses DelayEffect classwide consts

Defined at line 51 of file ../../src/media/audio/examples/effects/delay_effect.cc

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

static -- called from static EffectBase::Create

Defined at line 59 of file ../../src/media/audio/examples/effects/delay_effect.cc

void DelayEffect (uint32_t frame_rate, uint16_t channels, uint32_t delay_frames)

DelayEffect: instance member functions

Defined at line 76 of file ../../src/media/audio/examples/effects/delay_effect.cc

bool UpdateConfiguration (std::string_view config)

Defined at line 86 of file ../../src/media/audio/examples/effects/delay_effect.cc

bool ProcessInplace (uint32_t num_frames, float * audio_buff)

Delay the incoming stream by the number of frames specified in control 0.

TODO: with circular buffer, optimize 2N+D to N+min(N,D), where N=num_frames;

D=delay. Suggested algorithm: 1.copy min(N,D) from aud_buf to cache;

2.shift max(N-D,0) within aud_buf; 3.copy min(N,D) from cache to aud_buf.

Defined at line 105 of file ../../src/media/audio/examples/effects/delay_effect.cc

bool Flush ()

Retain control settings but drop any accumulated state or history.

Defined at line 122 of file ../../src/media/audio/examples/effects/delay_effect.cc