mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 14:02:29 -05:00
Merge pull request #54 from LLK/feature/shared-audio-context
Use audio-context module for shared audiocontext
This commit is contained in:
commit
6863ad25a2
2 changed files with 3 additions and 1 deletions
|
@ -21,6 +21,7 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/LLK/scratch-audio#readme",
|
"homepage": "https://github.com/LLK/scratch-audio#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"audio-context": "1.0.1",
|
||||||
"babel-core": "^6.24.1",
|
"babel-core": "^6.24.1",
|
||||||
"babel-eslint": "^7.2.2",
|
"babel-eslint": "^7.2.2",
|
||||||
"babel-loader": "^6.4.1",
|
"babel-loader": "^6.4.1",
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
const log = require('./log');
|
const log = require('./log');
|
||||||
|
|
||||||
|
const AudioContext = require('audio-context');
|
||||||
|
|
||||||
const PitchEffect = require('./effects/PitchEffect');
|
const PitchEffect = require('./effects/PitchEffect');
|
||||||
const PanEffect = require('./effects/PanEffect');
|
const PanEffect = require('./effects/PanEffect');
|
||||||
|
|
||||||
|
@ -149,7 +151,6 @@ class AudioPlayer {
|
||||||
*/
|
*/
|
||||||
class AudioEngine {
|
class AudioEngine {
|
||||||
constructor () {
|
constructor () {
|
||||||
const AudioContext = window.AudioContext || window.webkitAudioContext;
|
|
||||||
this.audioContext = new AudioContext();
|
this.audioContext = new AudioContext();
|
||||||
|
|
||||||
this.input = this.audioContext.createGain();
|
this.input = this.audioContext.createGain();
|
||||||
|
|
Loading…
Reference in a new issue