wasm/browser/src/utils/new-audio-context.js
raw| 1 | export const WebkitAudioContext = () => { |
| 2 | if (typeof window.webkitAudioContext !== "undefined") { |
| 3 | return window.webkitAudioContext; |
| 4 | } else if (typeof window.AudioContext !== "undefined") { |
| 5 | return window.AudioContext; |
| 6 | } |
| 7 | }; |
| 8 | |
| 9 | export const newAudioContext = () => { |
| 10 | const AudioCTX = WebkitAudioContext(); |
| 11 | if (AudioCTX) { |
| 12 | return new AudioCTX(); |
| 13 | } |
| 14 | } |