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

tquery required with the webaudio.min.js #18

Open
ghost opened this issue Apr 4, 2013 · 2 comments
Open

tquery required with the webaudio.min.js #18

ghost opened this issue Apr 4, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 4, 2013

seems like the minified version is the tquery one, I had to use the non minified version to make it work.

@jeromeetienne
Copy link
Owner

i dont understand.

here is how it is built https://github.com/jeromeetienne/webaudio.js/blob/master/Makefile#L32

webaudio.js is the core version. no plugin.

webaudio-bundle.js is the core version + bunch of plugins.

the .min is the minified version for each

@ghost
Copy link
Author

ghost commented Apr 4, 2013

Well when I link to the .min version I get an error about tQuery, when I link to the non minified version everything works fine. (but it might just be me being retarded)

I can see that in the min version tquery object are used :

tQuery.WebAudio=function(){console.assert(!0===tQuery.WebAudio.isAvailable,"webkitAudioContext isnt available on your browser");this._ctx=new webkitAudioContext;this._gainNode=this._ctx.createGainNode();this._compressor=this._ctx.createDynamicsCompressor();this._gainNode.connect(this._compressor);this._compressor.connect(this._ctx.destination)};tQuery.WebAudio.fn=tQuery.WebAudio.prototype;tQuery.WebAudio.prototype.destroy=function(){};tQuery.WebAudio.isAvailable=window.webkitAudioContext?!0:!1;

while in the normal version tquery is not called :

WebAudio    = function(){
    // sanity check - the api MUST be available
    if( WebAudio.isAvailable === false ){
        this._addRequiredMessage();
        // Throw an error to stop execution
        throw new Error('WebAudio API is required and not available.')  
    }

    // create the context
    this._ctx   = new webkitAudioContext();

    // setup internal variable
    this._muted = false;
    this._volume    = 1;

    // setup the end of the node chain
    // TODO later code the clipping detection from http://www.html5rocks.com/en/tutorials/webaudio/games/ 
    this._gainNode  = this._ctx.createGainNode();
    this._compressor= this._ctx.createDynamicsCompressor();
    this._gainNode.connect( this._compressor );
    this._compressor.connect( this._ctx.destination );  

    // init page visibility
    this._pageVisibilityCtor(); 
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant