Sampler in ChucK
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 년 전
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. var context = null;
  2. // success callback when requesting audio input stream
  3. function gotStream(stream) {
  4. window.AudioContext = window.AudioContext || window.webkitAudioContext;
  5. var ctx = new AudioContext();
  6. // Create an AudioNode from the stream.
  7. var micSource = ctx.createMediaStreamSource(stream);
  8. // Connect it to the destination to hear yourself (or any other node for processing!)
  9. micSource.connect(ctx.destination);
  10. }
  11. document.addEventListener('DOMContentLoaded', function() {
  12. //if (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia)
  13. //navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
  14. if (!navigator.getUserMedia) navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
  15. var constraints = { "audio": { "mandatory": { "googEchoCancellation": "false", "googAutoGainControl": "false", "googNoiseSuppression": "false", "googHighpassFilter": "false" }}}
  16. navigator.getUserMedia(constraints, gotStream, function(e) { alert('Error getting audio'); console.log(e); });
  17. //var controls = $("div#sliders");
  18. //controls.find("input[name='delayTime']").on('input', function() {
  19. //delay.delayTime.value = $(this).val();
  20. //});
  21. //controls.find("input[name='feedback']").on('input', function() {
  22. //feedback.gain.value = $(this).val();
  23. //});
  24. //controls.find("input[name='frequency']").on('input', function() {
  25. //filter.frequency.value = $(this).val();
  26. //});
  27. //delay = ctx.createDelay();
  28. //delay.delayTime.value = 0.5;
  29. //feedback = ctx.createGain();
  30. //feedback.gain.value = 0.8;
  31. //filter = ctx.createBiquadFilter();
  32. //filter.frequency.value = 1000;
  33. //delay.connect(feedback);
  34. //feedback.connect(filter);
  35. //filter.connect(delay);
  36. //source.connect(delay);
  37. //source.connect(ctx.destination);
  38. //delay.connect(ctx.destination);
  39. });