Native Audio cant find my mp3 files

I am using below code to load my mp3 files

this.nativeAudio.preloadSimple(‘sound2’, ‘assets/sound2.mp3’.then(() => {
console.log(‘preload success’)
}, (err) => {

However i get a error when preload the mp3 www/assets/sound2.mp3
I am sure the sound2.mp3 is placed in both /src/assets/sound2.mp3 and www/assets/sound2.mp3
Anyone got any ideas on it?

did you find any solution im also facing this issue

No i don’t. But now i use the html audio to play sound

private audioPlayer: HTMLAudioElement = new Audio();

how you used this html audio element please share that code with us

A simple solution would be to use native Audio.


// define the audio variable
let audio: HTMLAudioElement = new Audio();
constructor() {

public playAudio() {;

public pauseAudio() {;

public stopAudio(){; = 0;

private initAudio(){ = `/assets/audio/sample1.mp3`;;


<button (click)="playAudio()">Play</button>
<button (click)="pauseAudio()">Pause</button>
<button (click)="stopAudio()">Stop</button>
1 Like

@vestemeansorin91 did you tested this is the native app? Does it work?


go to:


then: change the code line

String fullPath = "www/".concat(assetPath)


String fullPath = "public/".concat(assetPath);