Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted unsupported by browsers "exports" #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions sound.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Thank you, Chris!

*/

(function (global, exports, perf) {
(function (global) {
'use strict';

function fixSetTarget(param) {
Expand Down Expand Up @@ -157,7 +157,6 @@ Thank you, Chris!

}(window));

var exports = module.exports = {};

/*
Define the audio context
Expand All @@ -167,7 +166,7 @@ All this code uses a single `AudioContext` If you want to use any of these funct
independently of this file, make sure that have an `AudioContext` called `actx`.
*/
var actx = new AudioContext();
exports.actx = actx;
window.actx = actx;

/*
sounds
Expand Down Expand Up @@ -286,7 +285,7 @@ var sounds = {
}
}
};
exports.sounds = sounds;
window.sounds = sounds;

/*
makeSound
Expand Down Expand Up @@ -613,7 +612,7 @@ function makeSound(source, loadHandler, shouldLoadSound, xhr, failHandler) {
//Return the sound object.
return o;
}
exports.makeSound = makeSound;
window.makeSound = makeSound;

//The `loadSound` function loads the sound file using XHR
function loadSound(o, source, loadHandler, failHandler) {
Expand All @@ -630,7 +629,7 @@ function loadSound(o, source, loadHandler, failHandler) {
//Send the request to load the file.
xhr.send();
}
exports.loadSound = loadSound;
window.loadSound = loadSound;

//The `decodeAudio` function decodes the audio file for you and
//launches the `loadHandler` when it's done
Expand All @@ -655,7 +654,7 @@ function decodeAudio(o, xhr, loadHandler, failHandler) {
}
);
}
exports.decodeAudio = decodeAudio;
window.decodeAudio = decodeAudio;

/*
soundEffect
Expand Down Expand Up @@ -940,7 +939,7 @@ function soundEffect(
node.stop(actx.currentTime + wait + 2);
}
}
exports.soundEffect = soundEffect;
window.soundEffect = soundEffect;

/*
impulseResponse
Expand Down Expand Up @@ -986,7 +985,7 @@ function impulseResponse(duration, decay, reverse, actx) {
//Return the `impulse`.
return impulse;
}
exports.impulseResponse = impulseResponse;
window.impulseResponse = impulseResponse;


/*
Expand Down Expand Up @@ -1016,7 +1015,7 @@ code from scratch.

Like I said, the `keyboard` function has nothing to do with generating sounds,
so just delete it if you don't want it!
*/


function keyboard(keyCode) {
var key = {};
Expand Down Expand Up @@ -1055,3 +1054,4 @@ function keyboard(keyCode) {
return key;
}
exports.keyboard = keyboard;
*/