Playing Sequentially audio files (Ionic 3 Native Audio)


down vote
I need to play a list of audio files one after another in Ionic 3

and i’m using ionic native audio plugin

playAll() {
    for (let i = 1; i <= 77; i++) {

async playAvecIonNative(i) {
    // this.currentBeyit = this.cpt;
    this.idAudio = 'w' + i;
    this.nativeAudio.preloadComplex(this.idAudio, 'assets/audio/' + i + '.ogg', 1, 1, 0)
      .then(await this.onSuccessPreloading, this.onErrorPreload);

  onSuccessPreloading = (data) => {
    this.scrollTo(i - 1); this.onSuccessPlaying, this.onErrorPlay);

  onSuccessPlaying = (a) => {

  onErrorPreload() {
    alert('ERREUR PRELOAD')

  onErrorPlay() {
    alert('ERREUR PLAY')

When i test with one audio file with the playAvecIonNative() it works great but for multiple file it doesn’t work as expected

Could you help me to achieve that ! Please !


It’s a bug with the plugin

The problem is on the callback wich execute at the same time when playing audio file.

Callback when file is done playing not working!

Did this get fixed? Did you get it to work/report it?


I need this as well. Nothing is working.
Any updates on how to accomplish this? Playing one short .mp3 after another.

All of my files play all at once, like a jumbled mess.



Hi @aboutwd,

I don’t think this has been fix.
You’ll have to make the preloaded sounds wait until.the previous sound has ended. Maybe consider using g a music/media controller to play the sou d sequential or make a function on your own.

Good luck!