mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 14:02:29 -05:00
Merge pull request #58 from paulkaplan/start-audio-ios
Use StartAudioContext to allow playing on mobile safari
This commit is contained in:
commit
e57484c2f5
2 changed files with 3 additions and 0 deletions
|
@ -31,6 +31,7 @@
|
|||
"json": "^9.0.6",
|
||||
"minilog": "^3.0.1",
|
||||
"soundfont-player": "0.10.5",
|
||||
"startaudiocontext": "1.2.1",
|
||||
"travis-after-all": "^1.4.4",
|
||||
"webpack": "2.4.0"
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
const StartAudioContext = require('startaudiocontext');
|
||||
const AudioContext = require('audio-context');
|
||||
|
||||
const log = require('./log');
|
||||
|
@ -153,6 +154,7 @@ class AudioPlayer {
|
|||
class AudioEngine {
|
||||
constructor () {
|
||||
this.audioContext = new AudioContext();
|
||||
StartAudioContext(this.audioContext);
|
||||
|
||||
this.input = this.audioContext.createGain();
|
||||
this.input.connect(this.audioContext.destination);
|
||||
|
|
Loading…
Reference in a new issue