webaudio.js 796 B

1234567891011121314151617181920212223242526272829
  1. /*!
  2. {
  3. "name": "Web Audio API",
  4. "property": "webaudio",
  5. "caniuse": "audio-api",
  6. "polyfills": ["xaudiojs", "dynamicaudiojs", "audiolibjs"],
  7. "tags": ["audio", "media"],
  8. "builderAliases": ["audio_webaudio_api"],
  9. "authors": ["Addy Osmani"],
  10. "notes": [{
  11. "name": "W3C Spec",
  12. "href": "https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html"
  13. }]
  14. }
  15. !*/
  16. /* DOC
  17. Detects the older non standard webaudio API, (as opposed to the standards based AudioContext API)
  18. */
  19. define(['Modernizr'], function(Modernizr) {
  20. Modernizr.addTest('webaudio', function() {
  21. var prefixed = 'webkitAudioContext' in window;
  22. var unprefixed = 'AudioContext' in window;
  23. if (Modernizr._config.usePrefixes) {
  24. return prefixed || unprefixed;
  25. }
  26. return unprefixed;
  27. });
  28. });