react-native-audio-ducking

React Native module for audio ducking (temporarily lowering the volume level of audio)

Usage no npm install needed!

<script type="module">
  import reactNativeAudioDucking from 'https://cdn.skypack.dev/react-native-audio-ducking';
</script>

README

react-native-audio-ducking

React Native module for audio ducking (temporarily lowering the volume level of audio)

Installation

npm install react-native-audio-ducking

iOS

npm install react-native-swift
react-native swiftify

Set the minimum iOS version 10.0

Android

no additional steps required

Usage

import AudioDucking from "react-native-audio-ducking";

// ...

  async function duckAudio() {
    try {
      await AudioDucking.duckAudio();
    } catch (error) {
      console.log('duckAudio error', error);
    }
  }

  async function removeAudioDucking() {
    try {
      await AudioDucking.removeAudioDucking();
    } catch (error) {
      console.log('removeAudioDucking error', error);
    }
  }

Contributing

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

License

MIT