# @types/react-native-audio

> TypeScript definitions for react-native-audio

Latest version **4.3.8** (published 2023-11-22) · MIT license · 0 weekly downloads

## Install

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

## 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 | 4.3.8 |
| Published | 2023-11-22 |
| First published | 2019-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

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

## Recent versions

- 4.3.8 (latest) — 2023-11-22
- 4.3.4 (ts3.6) — 2021-07-08
- 4.3.3 (ts3.3) — 2020-12-02
- 4.3.2 (ts3.0) — 2020-05-26
- 4.3.0 (ts2.0) — 2019-05-15
- 4.3.7 — 2023-11-07
- 4.3.6 — 2023-10-18
- 4.3.5 — 2023-09-27
- 4.3.1 — 2020-05-15

## README

# Installation
> `npm install --save @types/react-native-audio`

# Summary
This package contains type definitions for react-native-audio (https://github.com/jsierles/react-native-audio#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-audio.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-audio/index.d.ts)
````ts
export type AudioEncodingAndroidType = "aac_eld" | "amr_nb" | "amr_wb" | "he_aac" | "vorbis";

export type AudioEncodingIOSType = "lpcm" | "ima4" | "MAC3" | "MAC6" | "ulaw" | "alaw" | "mp1" | "mp2" | "alac" | "amr";

export type AudioEncodingType = "aac" | AudioEncodingAndroidType | AudioEncodingIOSType;

export interface RecordingOptions {
    SampleRate?: number | undefined;
    Channels?: number | undefined;
    AudioQuality?: "Low" | "Medium" | "High" | undefined;
    AudioEncoding?: AudioEncodingType | undefined;
    OutputFormat?: string | undefined;
    MeteringEnabled?: boolean | undefined;
    MeasurementMode?: boolean | undefined;
    AudioEncodingBitRate?: number | undefined;
    IncludeBase64?: boolean | undefined;
    AudioSource?: number | undefined;
}

export const AudioRecorder: {
    requestAuthorization(): Promise<boolean>;
    // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
    prepareRecordingAtPath(path: string, options: RecordingOptions): void | Promise<string>;
    startRecording(): Promise<string>;
    stopRecording(): Promise<string>;
    resumeRecording(): Promise<string>;
    pauseRecording(): Promise<string>;
    checkAuthorizationStatus(): Promise<boolean>;
    onProgress(res: { currentTime: number }): void;
    onFinished(res: { audioFileURL: string; base64: string; status: string }): void;
};

export const AudioUtils: {
    CachesDirectoryPath: string;
    DocumentDirectoryPath: string;
    DownloadsDirectoryPath: string;
    LibraryDirectoryPath: string;
    MainBundlePath: string;
    MusicDirectoryPath: string;
    PicturesDirectoryPath: string;
};

export const AudioSource: {
    CAMCORDER: number;
    DEFAULT: number;
    MIC: number;
    REMOTE_SUBMIX: number;
    UNPROCESSED: number;
    VOICE_CALL: number;
    VOICE_COMMUNICATION: number;
    VOICE_DOWNLINK: number;
    VOICE_RECOGNITION: number;
    VOICE_UPLINK: number;
};

````

### Additional Details
 * Last updated: Wed, 22 Nov 2023 00:24:48 GMT
 * Dependencies: none

# Credits
These definitions were written by [taoqf](https://github.com/taoqf).

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