Sunday 15 September 2013

api - why GainNode connections are not workinng? -


I am using the Web Audio API to get frecuency data from sound audio. Basically I have implemented this code which I want to add it, it's a beneficial, so I can control the volume at any place in my code, but there is something wrong with the connection I made, everything else Something works fine

Part of the quantity is the only thing that I have changed with the original code:

  request.onload = function () {context.decodeAudioData (request.response, Function ($ buffer) ($ ('buffer') {$ ('# info'). Text ('Error decoding data data'); return;} sourceJs = context.createJavaScriptNode (2048); sourceJs.buffer = buffer; SourceJs.connect (reference destination); Analyzer = reference.CutAlizer (); Analyzer.Softing timeConstant = 0.6; Analyzer.ftsis = 512; source = reference.computer source (); source buffer = buffer, source.nalyyser.connect (SourceJs); source Connect (context.destination); //////////////////////////////// // /////// /// VOLUME //////////////////// gainNode = context.createGain (); source.connect (gainNode)); GainNode.connect (context.destination); ////////////////////////////////// Source js.onaudioprocess = function (e) {array = new Uint8Array (Analyser.frequencyBinCount); Analyser.getByteFrequencyData (array); Boost = 0; For (var i = 0; i   

Then I used it to turn it off but did not work: ... gainNode.gain.value = 0;

You need to be the only thing in the benefit node that is source Connects to the output.

Right now, it has many connections and your profit node is one of them - which means that it is not affecting your entire signal.

No comments:

Post a Comment