Ionic native-audio doesn't work on android

I’m having a problem to use the native-audio cordova plugin with ionic. I installed native using npm

sudo npm install --save @ionic-native/native-audio

And added a new provider called smartAudio (code attached below).
It works like a charm both in ionic’s web view and on iOS emulator/real device as well… but for some reason there’s no sound on android emulators/real devices at all.

I have an ion-slides element that generate images slide using *ngFor, like this -

<ion-slides (ionSlideDidChange)="muteAnimalSound()" pager dir="rtl" [loop]="true" >
  <ion-slide *ngFor="let slide of animals_slides; let i = index" style="background-color: white">
    <img src="{{slide.img_url}}" (click)="playAnimalSound($event)">
    </ion-slide>
  </ion-slides>

Where playAnimalSound() function looks like this -

playAnimalSound(ev) {
    let animalSound = this.getAnimalBySource(ev.target.src);
    let currentIndex = this.slides.getActiveIndex();

    this.smartAudio.preload(currentIndex, animalSound[0].sound_url);
    this.smartAudio.play(currentIndex);
  }

My smartAudio provider was is defined like this -

export class SmartAudio {
 
    audioType: string = 'html5';
    sounds: any = [];
 
    constructor(public nativeAudio: NativeAudio, platform: Platform) {
 
        if(platform.is('cordova')){
            this.audioType = 'native';
        }
        //testing atlassian sourcetree
 
    }
 
    preload(key, asset) {
 
        if(this.audioType === 'html5'){
 
            let audio = {
                key: key,
                asset: asset,
                type: 'html5'
            };
 
            this.sounds.push(audio);
 
        } else {
 
            this.nativeAudio.preloadSimple(key, asset);
 
            let audio = {
                key: key,
                asset: key,
                type: 'native'
            };
 
            this.sounds.push(audio);
        }       
 
    }
 
    play(key){
 
        let audio = this.sounds.find((sound) => {
            return sound.key === key;
        });
 
        if(audio.type === 'html5'){
 
            let audioAsset = new Audio(audio.asset);
            audioAsset.play();
 
        } else {
 
            this.nativeAudio.play(audio.asset).then((res) => {
                console.log(res);
            }, (err) => {
                console.log(err);
            });
 
        }
 
    }
    stop(key)
    {
        let audio = this.sounds.find((sound) => {
            return sound.key === key;
        });
        
         if(audio.type === 'html5'){
 
            let audioAsset = new Audio(audio.asset);
            audioAsset.play();
 
        } else {
 
            this.nativeAudio.stop(audio.asset).then((res) => {
                console.log(res);
            }, (err) => {
                console.log(err);
            });
 
        }

    }
 
}

The paths are defined in a json structured like this:

{ name: 'cat', img_url: './assets/img/animals/cat.jpg', sound_url: './assets/sounds/animals/cat.wav' }

Anyone?.. please? I can’t find any information elsewhere…

Did you also added the cordova plugin ?

ionic cordova plugin add cordova-plugin-nativeaudio

yes, of course… and still no success.

Its 2020 now and still not working.

load is working:

this.nativeAudio.preloadComplex('theme', 'assets/audio/theme.mp3', 0.5, 1, 0).then(this.onSuccess, this.onError);

theme play is working in loop

this.nativeAudio.loop('theme').then(this.onSuccess, this.onError);

but to stop audio or mute by setting volume, its not doing anything. no error, no success.

            this.nativeAudio.stop('theme').then(this.onSuccess, this.onError);
            this.nativeAudio.setVolumeForComplexAsset('theme', 0.01).then(this.onSuccess, this.onError);;

Any working solution would be great.

"cordova-plugin-file": "^6.0.2",
"cordova-plugin-media": "^5.0.3",
"cordova-plugin-nativeaudio": "^3.0.9",

      "cordova-plugin-nativeaudio": {},
      "cordova-plugin-media": {},
      "cordova-plugin-file": {}