html5 audio tag on android devices
Ok
After a lot tried, I've finished to find what's the problem is.
For all people who have the same problem, check that your sampling frequency is in 44100 Hz (I don't seen anywhere this information but tried,...)
chrome for computer has support more frequencies but default's android browser and chrome mobile does'nt support higher frequency.
I hope that my experience will be used for someone else.
thanks at all who have seen this message (I'm on this bug from more than 3 days)
HTML5 audio tag is not working in Android
HTML5 Audio support is not consistent across different devices/OSes due to codec licensing issues and OS implementation/support. If you are just playing MP3 files, you can reliably handle those by using PhoneGap's Media class, which will provide consistent and reliable audio programming on all platforms.
If you want the ability to preload audio and have more advanced scenarios like polyphony or layering (like video game effects), you can use the LowLatencyAudio PhoneGap native plugin.
HTML5 audio tag does not work in Android - Chrome when created in JS?
Looks like this is intended feature that spans more then just the Chrome browser. User interaction is required to get media elements to play.
Blink and WebKit have a setting for requiring a “user gesture” to play or pause an audio or video element, which is enabled in Opera for Android, Chrome for Android, the default Android browser, Safari for iOS and probably other browsers. This makes some sense, since mobile devices are used in public and in bed, where unsolicited sound from random Web sites could be a nuisance. Also, autoplaying video ads would waste bandwidth. Block Quote from 'blog.foolip.org'
Duplicate Threads from Other Users
Autoplay audio on mobile safari
How can I autoplay media in ios 4.2.1
Autoplay audio with ios 5 workaround?
Current Status
Developers have requested the deletion of 'mediaPlaybackRequiresUserGesture' which was reviewed and denied (for now). "We're going to gather some data about how users react to autoplaying videos in order to decide whether to keep this restriction."
Upon further inspection i found this...
"I misunderstood the outcome of the discussion (removing mediaPlaybackRequiresUserGesture) surrounding this topic. We need to keep this code in order to not break google.com while gathering data about this feature."
Google.com relies on the feature being disabled, otherwise it breaks (they didn't say what it breaks).
Original Bug Report
HTML5 audio tag on Android
What you dug up agrees with what I've run into as well. 2.2 supports the audio tag but has no codecs to back it, this is apparently a bug that's been fixed in releases beyond Froyo:
http://code.google.com/p/android/issues/detail?id=9372
I've used the audio tag with an mp3 file on my Nexus S, it's working correctly there (for the most recent firmware release at least).
What are the limitations of HTML5 audio on Android and iOS?
Summary
MP3 seems to be the best bet for broad platform coverage. It is supported by the newest versions of all major desktop and mobile browsers. (Safari on iOS & Chrome on Android)
At the moment, playback through DataURIs is limited mainly to desktop browsers, but will soon become available in Android.
Android (default browser)
Formats
- Ogg Vorbis: Yes
- MP3: Yes
- FLAC: No (not 100% certain)
Data URIs
Yes
Autoplay allowed
TBC
User interaction event required
TBC
Limitations
- Full audio doesn't seem to play. (tested with short sounds)
Android (Chrome)
Formats
- Ogg Vorbis: Yes
- MP3: Yes
- FLAC: Yes
Data URIs
Yes (bug fixed in Chrome 34, which is currently in beta)
Autoplay allowed
No (bug)
User interaction event required
Yes
Limitations
- "ended" event never fires. (bug)
- "ended" event doesn't have user interaction privileges, so audio cannot be chained. (bug)
iOS
Formats
- Ogg Vorbis: No
- MP3: Yes
- FLAC: No
Data URIs
No (workaround for iOS 6; no known workaround for iOS 6+)
Autoplay allowed
TBC
User interaction event required
TBC
Limitations
TBC
Format tests performed using http://hpr.dogphilosophy.net/test/
HTML5 audio tag not working in Android Chrome
I actually found that HTML5 audio can't automatically play (to prevent large amounts data usage), and instead must be triggered by some event (i.e. click, etc.).
See here:
https://code.google.com/p/chromium/issues/detail?id=138132
Related Topics
Didn't Find Class on Path: Dexpathlist
Enable C++11 Support on Android
Automatic Versioning of Android Build Using Git Describe with Gradle
Android-Textview Settext in HTML.Fromhtml to Display Image and Text
Fragment View in Viewpager Is Not Restored When Resuming
Android Httpclient File Upload Data Corruption and Timeout Issues
Security "Crypto" Provider Deprecated in Android N
Import .R Cannot Be Resolved When I Import Actionbarsherlock
Failed to Execute Tools\Android.Bat: Solution
Android App Installation Failed: Package Com.My.App Has No Certificates at Entry Androidmanifest.Xml
App Crash After Activity Has Been Killed in Background
Android Emulator Failed to Allocate Memory 8
Intercept and Override Http Requests from Webview
Android Studio - Error:Program Type Already Present
Android- Phonegap/Webview Ignores Viewport Meta Tags
How to Load The Listview "Smoothly" in Android
Update SQL Database with Contentvalues and the Update-Method