Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71530

Recorded audio not playing in android kit kat, working fine in marshmallow

$
0
0

@vickytak wrote:

I am struggling with media plugin for playing recorded audio in android kit kat. I can record and save file in my application directory but its not playing audio. Its working fine in marshmallow. Below is the code that i am using.

startRecord(){
this.filename= 'demo.amr';

this.file.createFile(this.file.externalDataDirectory+this.filename,true).then((fileEntry)=>{

    this.fileUrl =  fileEntry.toInternalURL();
    this.myMedia = this.media.create(this.fileUrl,this.statusupdate, this.onSuccess, this.onError);
    this.myMedia.startRecord();
    let timer = 120;
    this.mediaTimer = setInterval(()=> {
    timer = timer - 1;
    if (timer <= 0) {
        clearInterval(this.mediaTimer);
        this.myMedia.stopRecord();
 		}

    }, 1000);
  });

}

playRecord(){
this.myMedia = this.media.create(this.fileUrl,this.statusupdate, this.onSuccess, this.onError);
this.myMedia.play();
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71530

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>