最終更新:2013-08-29 (木) 12:49:09 (3886d)
Web Audio API/Mobile Safari
Top / Web Audio API / Mobile Safari
メモ
- Apple独自の制限によりユーザ入力があるまでミュート状態になっている。
- https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/PlayingandSynthesizingSounds/PlayingandSynthesizingSounds.html
- Note: On iOS, the Web Audio API requires sounds to be triggered from an explicit user action, such as a tap. Calling noteOn() from an onload event will not play sound.
- 下記のようにtouchstartでAudioBufferSourceNodeをnoteOnしたら鳴るようになった。
- OscillatorNodeでもいいっぽい。
document.addEventListener('touchstart', function(){ if(!ctx)ctx = new webkitAudioContext(); var tmp = ctx.createBufferSource(); tmp.noteOn(0); }, false);