I\'m having some difficulties with getUserMedia with HTML5 whilst developing my web page. This is the first time I\'ve tried to implement this to record a users audio input.
function upload(blobOrFile) {
var xhr = new XMLHttpRequest();
xhr.open('POST', '/upload.aspx', true);
xhr.onload = function (e) {
var result = e.target.result;
};
xhr.send(blobOrFile);
}
// stop recording function calls the upload method
// I am using recorder.js
recorder.exportWAV(function (blob) {
var url = URL.createObjectURL(blob);
audio.src = url;
audio.controls = true;
var hf = document.createElement('a');
hf.href = url;
hf.download = new Date().toISOString() + '.wav';
upload(blob);
});
// on server side ASPX pageload - can save .wav file on server
Request.SaveAs(Server.MapPath("/foo/" + "1" + ".wav"), false);