SpectralAnalyzer
| Kind | class |
| Package | funkin.vis.dsp |
| Full name | funkin.vis.dsp.SpectralAnalyzer |
| Source | source/source-haxelib-patches/funkin/vis/dsp/SpectralAnalyzer.hx |
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
minDb | Float | no | -70 | property (default, set) |
maxDb | Float | no | -20 | property (default, set) |
fftN | Int | no | 4096 | property (default, set) |
minFreq | Float | no | 20 | — |
maxFreq | Float | no | 22000 | — |
Public methods
changeSnd
function changeSnd(audioSource:AudioSource)
| Parameter | Type | Default |
|---|---|---|
audioSource | AudioSource | — |
new (constructor)
function new(audioSource:AudioSource, barCount:Int, smoothingTimeConstant:Float = 0.8, peakHold:Int = 30)
| Parameter | Type | Default |
|---|---|---|
audioSource | AudioSource | — |
barCount | Int | — |
smoothingTimeConstant (optional) | Float | 0.8 |
peakHold (optional) | Int | 30 |
getLevels
function getLevels(?levels:Array<Bar>):Array<Bar>
| Parameter | Type | Default |
|---|---|---|
levels (optional) | Array<Bar> | — |
min
static inline function min<T:Float>(x:T, y:T):T
| Parameter | Type | Default |
|---|---|---|
x | T | — |
y | T | — |
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
audioSource | AudioSource | no |
audioClip | AudioClip | no |
barCount | Int | no |
smoothingTimeConstant | Float | no |
peakHold | Int | no |
fftN2 | Int | no |
htmlAnalyzer | AnalyzerNode | no |
bars | Array<BarObject> | no |
fft | FFT | no |
vis | — | no |
barHistories | — | no |
LN10 | Float | yes |
_buffer | Array<Float> | no |
| Method |
|---|
function normalizedB(value:Float) |
function calcBars(barCount:Int, peakHold:Int) |
function freqToBin(freq:Float, mathType:MathType = Round):Int |
function getSignal(data:lime.utils.UInt8Array, bitsPerSample:Int):Array<Float> |
static inline function clamp<T:Float>(val:T, min:T, max:T):T |
function set_minDb(value:Float):Float |
function set_maxDb(value:Float):Float |
function set_fftN(value:Int):Int |