Media Plugin

Can some tell me how to play audio mp3 files locally by placing it in assets folder in my app
I am new to ionic.


have you tried to do this?

yes i have tried but its not working

this.sound ='/android_asset/www/assets/sounds/beep.mp3'); // for android
this.sound ='assets/sounds/beep.mp3'); // for ios
1 Like

What has worked for me is to put the audio file into the assets/ folder. The assets folder is “compiled up” with your program and installed with it on the device. So, e.g., try this:

     <audio controls src="assets/My_Audio_File.mp3">

And put your My_Audio_file.mp3 file in the assets directory of your project.

ya thats right bro totally agree with you.