Changeset 29880 for main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/in-the-groove.js
- Timestamp:
- 2015-05-14T15:52:35+12:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/in-the-groove.js
r29867 r29880 1 "use strict"; 1 2 2 3 // https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor … … 4 5 var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); 5 6 7 //var InTheGroove = true; 6 8 var InTheGroove = false; 7 9 var MissingTheGroovePending = false; … … 16 18 var prev_input = [0,0]; 17 19 20 var tinnyEffectNode = null; 21 18 22 $(document).ready(function() { 19 23 $('#video').on('loadedmetadata', function() { 20 24 21 displayDuration(this.duration);25 //displayDuration(this.duration); 22 26 23 27 // Create a MediaElementAudioSourceNode 24 28 // Feed the HTMLMediaElement into it 25 29 var source = audioCtx.createMediaElementSource(this); 26 30 console.log("**** video source = " + source); 31 27 32 // connect the AudioBufferSourceNode to the tinnyEffectNode 28 33 // and the tinnyEffectNode to the destination, so we can play the … … 30 35 // pressed 31 36 32 vartinnyEffectNode = audioCtx.createScriptProcessor(bufferSize, 2, 2);37 tinnyEffectNode = audioCtx.createScriptProcessor(bufferSize, 2, 2); 33 38 tinnyEffectNode.onaudioprocess = function(e) { 34 39 … … 40 45 for (var i = 0; i < bufferSize; i++) { 41 46 if (InTheGroove) { 42 if (c==0) { 43 output[i] = input[i]; 44 } 45 else { 46 output[i] = 0; 47 } 47 output[i] = input[i]; 48 48 } 49 49 else { … … 51 51 output[i] = input[i] - prev_input[c]; 52 52 } 53 //if (i==128) { 54 // console.log("*** input[128] = " + input[i]); 55 //} 56 53 57 prev_input[c] = input[i]; 54 58 }
Note:
See TracChangeset
for help on using the changeset viewer.