foo-webview-sdk
    Preparing search index...

    Interface SpectrumFrameInfo

    Frame fields shared by audio:spectrum events and the audio.getSpectrum response, apart from spectrum itself. All optional: older hosts send spectrum only.

    interface SpectrumFrameInfo {
        bands?: number;
        channelCount?: number;
        channels?: SpectrumChannels;
        fftSize?: number;
        firstBin?: number;
        hostTime?: number;
        maxFrequency?: number;
        minFrequency?: number;
        output?: SpectrumOutput;
        sampleRate?: number;
        scale?: SpectrumScale;
        state?: SpectrumFrameState;
        streamTime?: number;
        subscriptionId?: string;
    }

    Hierarchy (View Summary)

    Index
    bands?: number

    Length of spectrum in a band frame; bin frames do not carry it.

    channelCount?: number

    Channel count of the visualisation stream, sent with bin frames; 0 when unknown. With channels: 'stereo' and a count of 1, right repeats left.

    channels?: SpectrumChannels

    Channel layout of a bin frame.

    fftSize?: number

    FFT size actually used: for band frames after the automatic raise for large band counts, for bin frames the requested size.

    firstBin?: number

    Bin index of the first value in a bin frame; 0 when the range holds no bin.

    hostTime?: number

    Host system time when the frame was computed, Unix epoch milliseconds with a fractional part. Compare with Date.now(); the page's performance.timeOrigin + performance.now() drifts away from system time the longer the page stays open.

    maxFrequency?: number

    Upper edge of the highest band in Hz: the subscription's maxFrequency capped at sampleRate / 2, or sampleRate / 2 when none was given; 0 when the sample rate is unknown.

    minFrequency?: number

    Lower edge of the lowest band in Hz: the subscription's minFrequency, 20 by default.

    What the frame carries. Older hosts send band frames without this field.

    sampleRate?: number

    Sample rate of the visualisation stream in Hz; 0 when unknown.

    Bin frames always report 'db'.

    'paused' / 'stopped' frames are single silence frames sent when playback leaves the playing state; no frames follow until playback resumes.

    streamTime?: number

    Seconds since the visualisation stream last started; the frame is computed from the fftSize samples ending at this time. Starting playback, seeking and manual track changes restart it at 0, where it stays for about 200 ms (silence frames); until fftSize / sampleRate seconds have passed, the part of the window before the restart is silence. Natural track transitions do not restart it. A frame is new when this value changed.

    subscriptionId?: string

    Subscription the frame belongs to; absent in getSpectrum answers without one.