# @types/audio-context

> TypeScript definitions for audio-context

Latest version **1.0.3** (published 2023-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/audio-context
pnpm add @types/audio-context
yarn add @types/audio-context
bun add @types/audio-context
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-11-06 |
| First published | 2019-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51370 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/audio-context
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/audio-context
- npm.io page: https://npm.io/package/@types/audio-context

## Recent versions

- 1.0.3 (latest) — 2023-11-06
- 1.0.1 (ts3.6) — 2021-07-07
- 1.0.0 (ts2.2) — 2019-09-06
- 1.0.2 — 2023-10-17

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/audio-context/index.d.ts)
````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](https://github.com/bdjeffyp).

---
_Source: https://npm.io/package/@types/audio-context · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
