We are trying to send our Audio file from the UI side using following code
var url = (window.URL || window.webkitURL).createObjectURL(blob);
var link = document.getElementById("save");
link.href = url;
link.download = filename || 'output.wav';
var fd = new FormData();
fd.append('fname', 'sample1.wav');
fd.append('data', blob);
$.ajax({
type: 'POST',
url: 'AudioToText',
data: fd,
processData: false,
contentType: "audio/wav"
});
But we are unable to process that in servlet. Can anybody help me with Javascript code to send audio file to servet and servlet code to save that audio fie in the servlet. Thanks in advance.