Created
March 19, 2011 23:26
-
-
Save also/877904 to your computer and use it in GitHub Desktop.
Modernizr tests for the Web Audio API and Audio Data API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test for the Web Audio API <http://chromium.googlecode.com/svn/trunk/samples/audio/specification/specification.html> | |
Modernizr.addTest('webAudioApi', function () { | |
return !!(window.webkitAudioContext || window.AudioContext); | |
}); | |
// Test for the Audio Data API <https://wiki.mozilla.org/Audio_Data_API> | |
Modernizr.addTest('audioDataApi', function () { | |
return !!new Audio().mozSetup; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
now living at
https://github.com/Modernizr/Modernizr/blob/master/feature-detects/audio-webaudio-api.js
and
https://github.com/Modernizr/Modernizr/blob/master/feature-detects/audio-audiodata-api.js