0.2.9 • Published 2 years ago

react-native-audio-library v0.2.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-audio-library

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

Installation

Run below command to install package.

npm install react-native-audio-library

This package is constructed on react-native-webrtc package for onyl call operations. Therefore, you should run below command if react-native-webrtc package is not installed already.

npm install react-native-webrtc

Usage

First, create instance of AudioSdk to get list of active audio output devices and change audio device.

#AudioSdk

import { AudioSdk, Device } from "react-native-audio-library";

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.

/**
 * 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

Only for iOS Get currently active devices.

audioSdk.updateDeviceList();

#updateAudioDevice

Update currently active audio output device.

audioSdk.updateAudioDevice(device.uid || device.type);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.2.9

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.8

2 years ago

0.2.5

2 years ago

0.2.1

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.1.3

2 years ago

0.2.4

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago