Software Archive
Read-only legacy content

Sound

Adam_t_1
Beginner
625 Views

Hi.

How can i add sound on my app ? When i add this HTML code its works only on my PC.But in mobile it does´t work. Please help me. Sorry for my language.

<audio controls>
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
0 Kudos
4 Replies
Amrita_C_Intel
Employee
625 Views

Hello,

 For playing back audio you can use the core Cordova media plugin or use your favorite Internet search engine to search for low latency audio cordova to find some third-party alternatives. 

0 Kudos
Chris_P_Intel
Employee
625 Views

Are you testing on a mobile device, or in the Emulator in the XDK?  Definitely test on device.

0 Kudos
PaulF_IntelCorp
Employee
625 Views

See this sample app for how to use the <audio> tag inside a webview, especially this part of the app: https://github.com/xmnboy/hello-cordova/blob/xdk-2323/www/js/main.js#L155

NOTE: older Android webviews may not work (anything on Android 4.3 and earlier) -- we highly recommend you use Crosswalk and test with the Debug tab, not the Test tab, because the Debug tab will run your app on Crosswalk.

0 Kudos
Nadeem_N_
New Contributor I
625 Views

Hi

Not All mobile support html5 audio so if you wanna make it supportable in all the application try n build ur app in crosswalk it will work.

0 Kudos
Reply