Programming audio for your website

Advertisemen

The AudioContext interface represents an audio-processing graph built from audio modules linked together, each represented by an AudioNode. An audio context controls both the creation of the nodes it contains and the execution of the audio processing, or decoding. You need to create an AudioContext before you do anything else, as everything happens inside a context.
An AudioContext can be a target of events, therefore it implements the EventTarget interface.
Browser Compatibility in Desktop
Feature Chrome Safari Edge Firefox Opera
Basic 10.0+ 6.0+ Yes 25.0+ 15.0+

Browser Compatibility in Mobile

Feature Android Edge Firefox Mobile Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic No support Yes 37.0+ 2.2+ No support No support No support Yes

For more info on compatibility : https://developer.mozilla.org/en/docs/Web/API/AudioContext

If you just want to have simple audio played in your website with limited controls, you can just use <audio> tag.

<audio controls>
<source src="aarlangdi.ogg" type="audio/ogg">
<source src="aarlangdi.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

For <audio> tag browser compatibility : 
Feature Chrome Safari Edge Firefox Opera
Basic 4.0+ 4.0+ 9.0+ 3.5+ 10.5+

For advance user :
Initializing audio in your browser :
<script>
var contextClass = (window.AudioContext ||
window.webkitAudioContext ||
window.mozAudioContext ||
window.oAudioContext ||
window.msAudioContext);
if (contextClass)
{
// Web Audio API is available.
var context = new contextClass();
}
else
{
// Your browser doesn't support web audio api,
// please use different browser
}
</script>

Advertisemen

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D