foo-webview-sdk
    Preparing search index...

    Interface AudioSubscribeSpectrumParams

    Parameters for audio.subscribeSpectrum. Subscribe to spectrum frames of the playing audio. Each subscription keeps its own parameters; frames arrive under event in the calling window only, at up to fps frames per second while playback runs, plus one silence frame when it pauses or stops.

    interface AudioSubscribeSpectrumParams {
        backgroundThrottle?: boolean;
        bands?: number;
        channels?: "mix" | "stereo";
        event?: string;
        fftSize?: number;
        fps?: number;
        maxFrequency?: number;
        minFrequency?: number;
        output?: "bands" | "bins";
        scale?: "weighted" | "db";
        subscriptionId?: string;
    }
    Index
    backgroundThrottle?: boolean

    true limits this subscription to at most 12 frames per second, usually 10 to 12, while another application is in the foreground; false keeps the full rate.

    true
    
    bands?: number

    Band output only: number of bands, clamped to 8..fftSize / 2.

    48
    
    channels?: "mix" | "stereo"

    Bin output only; stereo with band output fails with INVALID_PARAMS.

    "mix"
    
    event?: string

    Event name the frames are delivered under.

    "audio:spectrum"
    
    fftSize?: number

    FFT size, a power of two; other values fail with INVALID_PARAMS. Band output raises it for 32 or more bands; bin output uses it as given. 65536 is this component's ceiling, not a foobar2000 limit, and costs about 1.5 s of PCM per frame.

    1024
    
    fps?: number

    Frames per second, clamped to 1..60.

    30
    
    maxFrequency?: number

    Upper edge in Hz, greater than minFrequency. Capped at half the stream's sample rate when frames are computed, and follows it when omitted. A range entirely above that frequency yields silence frames.

    minFrequency?: number

    Lower edge of the frequency range in Hz; bands divide the range logarithmically.

    20
    
    output?: "bands" | "bins"

    What the frames carry; bands is ignored for bin output.

    "bands"
    
    scale?: "weighted" | "db"

    Band scale, weighted when omitted. With output: 'bins' omit it or pass db; anything else fails with INVALID_PARAMS.

    subscriptionId?: string

    Key of the subscription; subscribing again with the same id replaces that subscription. When omitted, the key is derived from the calling window and event.