# react-native-webrtc-audio

> Display active audio devices and change device on webrtc auido stream

Latest version **0.2.12** (published 2023-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-webrtc-audio
pnpm add react-native-webrtc-audio
yarn add react-native-webrtc-audio
bun add react-native-webrtc-audio
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.12 |
| Published | 2023-02-08 |
| First published | 2022-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 373.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Armakom |
| Maintainers | armakomnpm |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-webrtc-audio
- Repository: https://github.com/armakomnpm/react-native-webrtc-audio
- Homepage: https://github.com/armakomnpm/react-native-webrtc-audio#readme
- Issues: https://github.com/armakomnpm/react-native-webrtc-audio/issues
- npm.io page: https://npm.io/package/react-native-webrtc-audio

## Dependencies (2)

- [react-native-verto-ts](https://npm.io/package/react-native-verto-ts.md) ^0.2.50
- [@react-native-async-storage/async-storage](https://npm.io/package/@react-native-async-storage/async-storage.md) ^1.17.6

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.2.12 (latest) — 2023-02-08
- 0.2.11 — 2022-06-24
- 0.2.10 — 2022-06-21

## README

# react-native-webrtc-audio

Display active audio devices and change audio device output on webrtc auido stream

## Installation

Run below command to install package.

```sh
npm install react-native-webrtc-audio
```
This package is constructed on <strong>react-native-webrtc</strong> package for onyl call operations. Therefore, you should run below command if <strong>react-native-webrtc</strong> package is not installed already.

```sh
npm install react-native-webrtc
```

## Usage

First, create instance of <strong>AudioSdk</strong> to get list of active audio output devices and change audio device.

### \#AudioSdk

```js
import { AudioSdk, Device } from "react-native-webrtc-audio";

const onAudioDevicesUpdated = (devices: Array<Device>) => {
    console.log('[onAudioDevicesUpdated] devices:', JSON.stringfy(devices));
}

const audioSdk: AudioSdk = new AudioSdk({
    onAudioDevicesUpdated
});

```

### \#updateAudioMode

Update AudioMode for call states to activate/deactivate callback for [audio devices](README.md#AudioSdk).

```js
/**
 * Updates the audio mode based on call states.
 * 
 * @param inCall Set true if any call exists
 * @param isVideo Set true for video calls
 */
public updateAudioMode(inCall?: boolean, isVideo?: boolean);
```

### \#updateDeviceList

<strong>Only for iOS</strong>
Get currently active devices.

```js
audioSdk.updateDeviceList();
```

### \#updateAudioDevice
Update currently active audio output device.

```js
audioSdk.updateAudioDevice(device.uid || device.type);
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

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