Audio Management

Contents

A Cordova plugin to manage volume of audio streams for: ring, music, notification and system. Possible ringer values for those streams are: silent, vibrate and normal.

https://github.com/clovelCed/cordova-plugin-audiomanagement

Stuck on a Cordova issue?

Installation

Community Enterprise
ionic cordova plugin add clovelced-plugin-audiomanagement npm install @ionic-native/audio-management
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More   or   Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/audio-management

Supported Platforms

  • Android

Usage

import { AudioManagement } from '@ionic-native/audio-management/ngx';


constructor(public audioman: AudioManagement) { }

...

setAudioMode() {
 this.audioman.setAudioMode(AudioManagement.AudioMode.NORMAL)
   .then(() => {
    console.log('Device audio mode is now NORMAL');
   })
   .catch((reason) => {
     console.log(reason);
   });
}

getAudioMode() {
 this.audioman.getAudioMode()
   .then((value: AudioManagement.AudioModeReturn) => {
    console.log('Device audio mode is ' + value.label + ' (' + value.audioMode + ')');
   })
   .catch((reason) => {
     console.log(reason);
   });
}