summaryrefslogtreecommitdiff
path: root/servers/audio/effects/audio_effect_pitch_shift.h
diff options
context:
space:
mode:
authorMartin Dahlgren <mdahlgrengadd@users.noreply.github.com>2019-06-03 12:56:45 +0200
committerMartin Dahlgren <mdahlgrengadd@users.noreply.github.com>2019-06-03 12:56:45 +0200
commitf78c7377c914f9f2f7dc428030a7cf07f7614df0 (patch)
tree3d2309360d94bec696a7f355a207dd3332746e60 /servers/audio/effects/audio_effect_pitch_shift.h
parent8b0ea337771a2ec04f8c731601c6a0518187b328 (diff)
Make FFT size and oversampling adjustable for pitchshifting
Diffstat (limited to 'servers/audio/effects/audio_effect_pitch_shift.h')
-rw-r--r--servers/audio/effects/audio_effect_pitch_shift.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/servers/audio/effects/audio_effect_pitch_shift.h b/servers/audio/effects/audio_effect_pitch_shift.h
index febc20e9d5..0c80cb6344 100644
--- a/servers/audio/effects/audio_effect_pitch_shift.h
+++ b/servers/audio/effects/audio_effect_pitch_shift.h
@@ -76,6 +76,7 @@ class AudioEffectPitchShiftInstance : public AudioEffectInstance {
friend class AudioEffectPitchShift;
Ref<AudioEffectPitchShift> base;
+ int fft_size;
SMBPitchShift shift_l;
SMBPitchShift shift_r;
@@ -85,11 +86,22 @@ public:
class AudioEffectPitchShift : public AudioEffect {
GDCLASS(AudioEffectPitchShift, AudioEffect)
+public:
+ enum FFT_Size {
+ FFT_SIZE_256,
+ FFT_SIZE_512,
+ FFT_SIZE_1024,
+ FFT_SIZE_2048,
+ FFT_SIZE_4096,
+ FFT_SIZE_MAX
+ };
+public:
friend class AudioEffectPitchShiftInstance;
float pitch_scale;
- int window_size;
+ int oversampling;
+ FFT_Size fft_size;
float wet;
float dry;
bool filter;
@@ -103,7 +115,15 @@ public:
void set_pitch_scale(float p_pitch_scale);
float get_pitch_scale() const;
+ void set_oversampling(int p_oversampling);
+ int get_oversampling() const;
+
+ void set_fft_size(FFT_Size);
+ FFT_Size get_fft_size() const;
+
AudioEffectPitchShift();
};
+VARIANT_ENUM_CAST(AudioEffectPitchShift::FFT_Size);
+
#endif // AUDIO_EFFECT_PITCH_SHIFT_H