Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

AudioEffectPitchShift

繼承: AudioEffect < Resource < RefCounted < Object

Adds a pitch-shifting audio effect to an audio bus.

Raises or lowers the pitch of the input audio.

說明

Allows modulation of pitch without modifying speed. All frequencies can be raised or lowered with minimal effect on transients.

教學

屬性

FFTSize

fft_size

3

int

oversampling

4

float

pitch_scale

1.0


列舉

enum FFTSize: 🔗

FFTSize FFT_SIZE_256 = 0

使用 256 個取樣點進行快速傅立葉轉換。延遲最低,但長時間穩定性最差。

FFTSize FFT_SIZE_512 = 1

使用 512 個取樣點進行快速傅立葉轉換。延遲低,但長時間穩定性較差。

FFTSize FFT_SIZE_1024 = 2

使用 1024 個取樣點進行快速傅立葉轉換。延遲與穩定性折衷。

FFTSize FFT_SIZE_2048 = 3

使用 2048 個取樣點進行快速傅立葉轉換。延遲高,但穩定。

FFTSize FFT_SIZE_4096 = 4

使用 4096 個取樣點進行快速傅立葉轉換。延遲最高,但穩定性最佳。

FFTSize FFT_SIZE_MAX = 5

代表 FFTSize 列舉的大小。


屬性說明

FFTSize fft_size = 3 🔗

The size of the Fast Fourier transform buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on audio signals that have sudden amplitude changes.


int oversampling = 4 🔗

  • void set_oversampling(value: int)

  • int get_oversampling()

過取樣係數。值越高音質越好,但 CPU 負擔也越重,若處理不及可能導致爆音。


float pitch_scale = 1.0 🔗

  • void set_pitch_scale(value: float)

  • float get_pitch_scale()

The pitch scale to use. 1.0 is the default pitch and plays sounds unaffected. pitch_scale can range from 0 (infinitely low pitch, inaudible) to 16 (16 times higher than the initial pitch).