@types/audio-context
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Installation

npm install --save @types/audio-context

Summary

This package contains type definitions for audio-context (https://github.com/audiojs/audio-context).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/audio-context.

index.d.ts

/**
 * Options for your audio context:
 * @param sampleRate if specified, will set the context sampleRate.
 * @param latencyHint if specified, will control latency. One of 'balanced', 'playback', 'interaction' (default) or number.
 * @param offline if specified, will create OfflineAudioContext.
 * @param length if specified, will set number of frames for offline context.
 * @param channels if specified, will set number of channels for offline context.
 * @param contextAttributes any other options for the context.
 */
declare namespace getContext {
    interface Options {
        sampleRate?: number | undefined;
        latencyHint?: string | number | undefined;
        offline?: boolean | undefined;
        length?: number | undefined;
        channels?: number | undefined;
        contextAttributes?: object | undefined;
    }
}

/**
 * Gets an audio context from your web browser.
 * @param options Takes an Options object or just provide a sample rate.
 * @returns the audio context or null if there was an error or not a web browser.
 */
declare function getContext(options?: getContext.Options | number): AudioContext | null;

export = getContext;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:04 GMT
  • Dependencies: none

Credits

These definitions were written by Jeff Peterson.

Dependents (1)

Package Sidebar

Install

npm i @types/audio-context

Weekly Downloads

84

Version

1.0.3

License

MIT

Unpacked Size

4.9 kB

Total Files

5

Last publish

Collaborators

  • types