Realtime Javascript synth on Android/IOS. HTML5 audio tag won't take injected data

779 Views Asked by At

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.

2

There are 2 best solutions below

1
On BEST ANSWER

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.

1
On

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/