Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var audio_context;
- var recorder;
- window.onload = function init() {
- try {
- window.AudioContext = window.AudioContext || window.webkitAudioContext;
- navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia;
- window.URL = window.URL || window.webkitURL;
- audio_context = new AudioContext;
- } catch (e) {
- console.log(e);
- }
- navigator.getUserMedia({audio: true}, startUserMedia);
- function startUserMedia(stream) {
- console.log('Initializing');
- var input = audio_context.createMediaStreamSource(stream);
- input.connect(audio_context.destination);
- var node = input.context.createGain(4096, 2, 2);
- node.onaudioprocess = function(e){
- console.log('done');
- }
- node.connect(audio_context.destination);
- }
- };
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement