Native audio error message


#1

Hi

		this.platform.ready().then(() => {
			this.nativeAudio.preloadComplex(.....,....., 1, 1, 0)
						.then(() => {this.nativeAudio.play(.....);});			
			this.nativeAudio.play(.....);}

chrome://inspect
First run

after run


why this error,I dont understand


#2

My guess:
First run: Your last line of the code you posted does the same as the line before, but outside of the then which doesn’t work as the preloading is not finished yet.
Later runs: You can’t preload the same ID multiple times. You should probably check if it is already preloaded by catching the error in the Promise.


#4

How is first run error solution?
only this code

this.platform.ready().then(() => {
			this.nativeAudio.preloadComplex(.....,....., 1, 1, 0)
						.then(() => {this.nativeAudio.play(.....);});}

sometimes dont working


#5

I have no idea what you are saying.


#7

That has nothing to do with the thing this topic is about - specific error messages. Please open a new topic for this if you haven’t done so already.


#8

Ok.


#9

First run: Your last line of the code you posted does the same as the line before, but outside of the then which doesn’t work as the preloading is not finished yet.

I mean I don’t need to write the last line

this.platform.ready().then(() => {
			this.nativeAudio.preloadComplex(.....,....., 1, 1, 0)
						.then(() => {this.nativeAudio.play(.....);});

but after come to same page.its dont work


#10
this.platform.ready().then(() => {
			this.nativeAudio.preloadComplex(....,......, 1, 1, 0);
			this.nativeAudio.preloadComplex(.....,....., 1, 1, 0);
			this.nativeAudio.preloadComplex(.....,.....l, 1, 1, 0);
		});
	}

	

This is myPage.
After diffrent page push the this myPage.And this same error.
Thanks.


#11
this.nativeAudio.preloadComplex(..................,................, 1, 1, 0);
this.nativeAudio.preloadComplex(..................,................, 1, 1, 0);
this.nativeAudio.preloadComplex(..................,................, 1, 1, 0);

what I need to write id


#12

OK.I’m solved this error.
Thank you to everyone who helped


#13

Please post the solution and then select it as “solution” (checkbox under the post) so future visitors of your posts also can see how to fix the problem.


#14

I’m used to

this.nativeAudio.preloadComplex(..................,................, 1, 1, 0);

But same id error.So on Leave page

this.nativeAudio.unload(..........);

unload(id)==>Unloads an audio file from memory