-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioEffect.h
More file actions
41 lines (34 loc) · 1.16 KB
/
AudioEffect.h
File metadata and controls
41 lines (34 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ./AudioEffect.h
// 全てのオーディオエフェクトクラスが継承する抽象基底クラス
#pragma once
#include <vector>
#include <string>
#include <nlohmann/json.hpp>
// jsonエイリアス
using json = nlohmann::json;
class AudioEffect {
public:
// デストラクタは仮想にする
virtual ~AudioEffect() = default;
/**
* @brief エフェクトのパラメータを設定する
* @param sr サンプリングレート
* @param params JSONオブジェクト形式のパラメータ
*/
virtual void setup(double sr, const json& params) = 0;
/**
* @brief オーディオデータをブロック単位で処理する
* @param block 処理対象のオーディオデータブロック(インターリーブ形式)
* @param channels チャンネル数
*/
virtual void process(std::vector<float>& block, int channels) = 0;
/**
* @brief エフェクトの内部状態をリセットする
*/
virtual void reset() = 0;
/**
* @brief エフェクトの名前を取得する
* @return エフェクト名
*/
virtual const std::string& getName() const = 0;
};