Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

WebAudioUtils.js 418B

1234567891011121314
  1. /**
  2. * Adapter that creates AudioContext objects depending on the browser.
  3. *
  4. * @returns {AudioContext} - Return a new AudioContext or undefined if the browser does not support it.
  5. */
  6. export function createAudioContext(options) {
  7. const AudioContextImpl = window.AudioContext || window.webkitAudioContext;
  8. if (!AudioContextImpl) {
  9. return undefined;
  10. }
  11. return new AudioContextImpl(options);
  12. }