Google Drive files (audio files) in ios

#1

Hi all,

I am developing an application that will allow me to record some audios and store them directly on google drive account. I am able to perform this.
Now, after the audio file is being saved in Google drive I wish to have it back in application to perform certain annotation, like attaching some notes. The concern here is that when I import the audio file back in application from drive, the audio file is not playing. I am not able to hear anything of my recording. I am downloading the audio file in local storage before playing the file in the application.

I am able to play and hear audio in google drive player, its just when I import the audio file back in application it is not working.

I am using Ionic media plugin for recording and playing back the audio file.
Audio file is stored in m4a format.
using ionic 3

Kindly assist me, as it has been days and I am struggling to play the stored audio files from google drive in my application.

#2

Any one in the forum that can assist me with my struggle.

#3

Please add google api token when your trying to download / play from google drive . Like I am downloading it from drive before playing , below is the way I am adding token :

let GoogleDriveURL =“https://www.googleapis.com/drive/v3/files/"+fileId+"?alt=media”;
let headerCred = {
headers: {
“Authorization”: "Bearer "+this.accessToken , // this the access token of google drive
“cache-control”: “no-cache”,
}
this.fileTransferObject.download(GoogleDriveURL, this.file.tempDirectory+fileName, true , headerCred).then((entry) => {
— Code Here -------

}

This issue may be coming due to authentication only , please try this hope this will help you out .