react-native-switch-audio-output-android-normal-mode
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

react-native-switch-audio-output-android

Library for selecting audio output source (only for Android). Uses Android's AudioManager class.

Getting started

npm install react-native-switch-audio-output-android-normal-mode
# or
yarn add react-native-switch-audio-output-android-normal-mode

Usage

import AudioOutput from 'react-native-switch-audio-output-android-normal-mode';

// Get list of possible devices
const devices = await AudioOutput.getAudioDevices();
// Returns a list of possible devices
// ["Speaker", "Bluetooth", "Headphones"]

// Switch to desired device
AudioOutput.setAudioDevice("Bluetooth");
// Note: the device must be one of the values that getAudioDevices() returned

Credits

The original code is from https://github.com/anttivuor/react-native-switch-audio-output-android by Antti Vuorenmaa

Package Sidebar

Install

npm i react-native-switch-audio-output-android-normal-mode

Weekly Downloads

7

Version

1.0.4

License

MIT

Unpacked Size

75.3 kB

Total Files

12

Last publish

Collaborators

  • devgameplaygame