문제

I have an Javascript application that creates some audio tones and plays them. The tones are generated as a WAV file then injected like this....

<audio id="player" controls autobuffer="autobuffer" />
<script type="text/javascript" charset="utf-8">
  document.getElementById("player").src = wavData;
  document.getElementById("player").play();
</script>

This works on recent versions of Chrome or Firefox on a PC but not on any mobile device I tried including Android 4.0.3, Android 2.3 and an IPhone.

Another example of a Javascript synth that works on a desktop but not an Android device is this "Morning Star" synth. http://bitterspring.net/ms/morningstar/

An example of HTML5 audio that does work on Android is this test page. http://textopia.org/androidsoundformats.html .

Is there a workaround? I want a solution based entirely on HTML/Javascript.

도움이 되었습니까?

해결책

MorningStar author here: my synth does not use any <audio> tag, it uses Web Audio API.

I haven't tested it on Android devices (yet), but if the stock Android browser doesn't support Web Audio API, there's no way the synth could work.

다른 팁

Android 2.3 does not have good support for the tag. One solution is to do is use flash on android.

this might help. http://www.schillmania.com/projects/soundmanager2/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top