<commit_before>var recorder = document.getElementById('recorder');
var player = document.getElementById('player');

recorder.addEventListener("change", function(e) {
  var file = e.target.files[0];
  // Do something with the audio file.
  player.src =  URL.createObjectURL(file);
});




var playertwo = document.getElementById('player');

var handleSuccess = function(stream) {
  if (window.URL) {
    playertwo.src = window.URL.createObjectURL(stream);
  } else {
    playertwo.src = stream;
  }
};

navigator.mediaDevices.getUserMedia({ audio: true, video: false })
    .then(handleSuccess)
<commit_msg>added storing microphone data sample code<commit_after>var recorder = document.getElementById('recorder');
var player = document.getElementById('player');

recorder.addEventListener("change", function(e) {
	var file = e.target.files[0];
	// Do something with the audio file.
	player.src = URL.createObjectURL(file);
});




var playertwo = document.getElementById('player');

var handleSuccess = function(stream) {
	if (window.URL) {
		playertwo.src = window.URL.createObjectURL(stream);
	} else {
		playertwo.src = stream;
	}
};

navigator.mediaDevices.getUserMedia({
		audio: true,
		video: false
	})
	.then(handleSuccess)






let shouldStop = false;
let stopped = false;
const downloadLink = document.getElementById('download');
const stopButton = document.getElementById('stop');

stopButton.addEventListener('click', function() {
	shouldStop = true;
})

var handleSuccess = function(stream) {
	const options = {
		mimeType: 'video/webm;codecs=vp9'
	};
	const recordedChunks = [];
	const mediaRecorder = new MediaRecorder(stream, options);

	mediaRecorder.addEventListener('dataavailable', function(e) {
		if (e.data.size > 0) {
			recordedChunks.push(e.data);
		}

		if (shouldStop === true && stopped === false) {
			mediaRecorder.stop();
			stopped = true;
		}
	});

	mediaRecorder.addEventListener('stop', function() {
		downloadLink.href = URL.createObjectURL(new Blob(recordedChunks));
		downloadLink.download = 'acetest.wav';
	});

	mediaRecorder.start();
};

navigator.mediaDevices.getUserMedia({
		audio: true,
		video: false
	})
	.then(handleSuccess);

{'fraction_non_alphanumeric': 0.14167433302667892, 'fraction_numerical': 0.0018399264029438822, 'mean_word_length': 4.846774193548387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '314550', 'n_tokens_mistral': 713, 'n_tokens_neox': 670, 'n_words': 139}