mudcube / AudioSupports.js

Detects what audio formats (OGG Opus, OGG Vorbis, MP3) your browser can play and whether your browser supports HTML5 Audio, WebAudioAPI and MIDI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AudioSupports(...)

Probably, Maybe, No... Absolutely!

This handy little method detects Audio formats and features your browser supports.

AudioSupports(function (supports) {

});

An example output would be:

	 {
		 'audio': { // these are supported on new Audio()
			 'vorbis': true,
			 'opus': true,
			 'mp3': true
		 },
		 'audioapi': { // these are supported on new AudioContext()
			 'vorbis': false,
			 'opus': false,
			 'mp3': true
		 },
		 'midiapi': true,
		 'vorbis': true, // these are supported either on Audio() or AudioContext()
		 'opus': true,
		 'mp3': true
	 }

Register custom formats:

AudioSupports.register(format, codec, base64);

About

Detects what audio formats (OGG Opus, OGG Vorbis, MP3) your browser can play and whether your browser supports HTML5 Audio, WebAudioAPI and MIDI.


Languages

Language:JavaScript 100.0%