goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
24.04k stars 2.24k forks source link

Not playing on Samsung Galaxy Tab 2 #107

Closed perqa closed 8 years ago

perqa commented 10 years ago

I'm using howler.js v1.1.14 in a cross-platform app, which works well on iOS, but is completely silent on my Samsung Galaxy Tab 2. There is only one audio format used: mp3, but the tablet supports mp3, according to the specs.

Initialization:

var bgMusic = new Howl({
    urls: ['sounds/bg_music_drutten_mixdown.mp3'],
    loop: true,
    volume: 0.3
});

var click = new Howl({
    urls: ['sounds/Click_01.mp3']
});

EDIT:

Actually, the first two (basic) examples on the home page work fine in the tablet (see http://goldfirestudios.com/blog/104/howler.js-Modern-Web-Audio-Javascript-Library). I guess that indicates I should add ogg files to my app....

The first two examples start without any delay. The third example, though, (audio sprite), has a very long start delay every time.

goldfire commented 10 years ago

Are you testing this in the stock Android browser or a different one?

perqa commented 10 years ago

I'm using the stock Android browser, or more precisely the webview in a Phonegap app, but that should be equivalent to the stock Android browser.

scotthorn commented 10 years ago

I can confirm this issue on different hardware. I'm making a webview app on my Nexus 7. Android 4.4 uses chromium for webview rendering, so there shouldn't be a problem, but I can't get an ogg file to autoplay. It doesn't work in the actual chrome browser either, but if I pull up the file url it will indeed play (just not on load). I'm not sure if there are any methods left for autoplaying audio through Android browsers.

goldfire commented 10 years ago

If what you are trying to do is autoplay, then this won't work on mobile. Most mobile browsers require user interaction before audio can begin to play.

https://code.google.com/p/chromium/issues/detail?id=138132

perqa commented 10 years ago

I don't care about autoplay. I just want the audio sprites to play.

goldfire commented 10 years ago

Are they not playing at all when triggered by a user action?

perqa commented 10 years ago

They are playing, but after a long delay (like 1 s). The single sounds (non-sprites) play with virtually no latency at all.

behindbeyond commented 10 years ago

Did anyone solve the sound issue on the Samsung Galaxy Tab 2 ? I am using Howler.js as well. No sound on my Android Tablet.

Phonegap + Android + Howler.js

thejae commented 10 years ago

Just wanted to chime in on this issue. It also applies to other sound libraries e.g SoundManager 2. The chances Howlerjs works on Cordova PhoneGap is low since Cordova doesn't fully adheres to W3C's HTML5 standards - it uses its own 'Media API' for audio playback/ recording.

Reference: https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md

joefaron commented 10 years ago

The android default browser on 4.3 (Galaxy S3) doesn't play sounds over eachother. I've tried buffer:false, doesn't work. Sound sprites play over each other fine on Android Chrome.. :/

The blaster / winner demo example is all you need for testing on it.. help?