4.11.2 • Published 7 years ago
@fcarreno/ionic-native-audio v4.11.2
Fork of @ionic-native/native-audio plugin wrapper:
Allows playing audio files under res/raw files included in android bundle apk, by providing just the file name (without extension) of the resource
Requires usage of extended plugin, as well, under https://github.com/fcarreno/cordova-plugin-nativeaudio
Installation:
$ npm install --save @fcarreno/ionic-native-audio
Usage:
First, import the plugin wrapper the same way - as explained here: https://ionicframework.com/docs/native/native-audio/ (Usage section)
Then, use the extended method, to play audio files under your res/raw android bundle folder:
E.g.: (assuming nativeAudio is the way the plugin wrapper has been declared in your constructor, and beep is the name of your audio file under res/raw)
this.nativeAudio.preloadSimpleRawResource('uniqueId', 'beep');