28 lines
451 B
C
28 lines
451 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
struct gate {
|
|
float threshold;
|
|
bool enable_calibration;
|
|
|
|
unsigned block_size;
|
|
unsigned cur_block_count;
|
|
float cur_block_sum;
|
|
float last_block_sum;
|
|
|
|
bool is_active;
|
|
float cur_gain;
|
|
|
|
float attack;
|
|
float release;
|
|
};
|
|
|
|
void gate_init();
|
|
void gate_process(
|
|
struct gate* gate,
|
|
size_t frame_size,
|
|
float const* in,
|
|
float* out);
|