Changeset 28401


Ignore:
Timestamp:
10/14/13 10:10:49 (7 years ago)
Author:
davidb
Message:

if-statement guards added for when the graphics equalizer is not in use

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/web-audio/trunk/js-dsp/frequency-player.js

    r28388 r28401  
    304304        }
    305305
    306         leftSignal = grapheqL.process(leftSignal);
    307         rightSignal = grapheqR.process(rightSignal);
     306        if ((typeof grapheqL !== "undefined") && (typeof grapheqR !== "undefined")) {
     307        leftSignal = grapheqL.process(leftSignal);
     308        rightSignal = grapheqR.process(rightSignal);
     309        }
    308310
    309311        for (var i=0; i<mono_len; i++) {
     
    316318
    317319        // untested code // *****
    318         var fbLeft  = grapheqL.process(fb);     
    319         var fbRight = grapheqR.process(fb);
     320
     321        var fbLeft;
     322        var fbRight;       
     323
     324        if ((typeof grapheqL !== "undefined") && (typeof grapheqR !== "undefined")) {
     325        fbLeft  = grapheqL.process(fb);     
     326        fbRight = grapheqR.process(fb);
     327        }
     328        else {
     329        fbLeft  = new Float32Array(mono_len);
     330        fbRight = new Float32Array(mono_len);
     331        for (var i=0; i<mono_len; i++) {
     332            fbLeft[i]  = fb[i];
     333            fbRight[i] = fb[i];
     334        }
     335        }
    320336
    321337        var mono_len = fb.length;
     
    326342        fb[(2*i)+1] = fbRight[i];
    327343        }
    328 
    329344    }
    330345
Note: See TracChangeset for help on using the changeset viewer.