I have site using php frame work codigniter where I am using the mattdiamond/Recorderjs to record an audio file in blob content type then i am uploading it to the server but it is taking top much time to upload I want to minimize my uploading time. Max size of audio file is 4mb and it is taking 1 minute to 4 minutes for uploading to server.
$(document).on("click", "#save:not(.disabled)", function(){
Fr.voice.export(function(blob){
var formData = new FormData();
formData.append('file.wav', blob);
formData.append('question_id',question_id);
formData.append('test_id',test_id);
formData.append('section_id',section_id);
formData.append('sub_section_id',sub_section_id);
$.ajax({
url: "https://www.example.com/pte/upload",
type: 'POST',
data: formData,
contentType: false,
processData: false,
success: function(response) {
if(response.status=="success"){
$('#recording-status').html("Recording save successfully.");
$('#recording-status').addClass("text-success");
$("#nextbtn1").prop('disabled', false);
href = $("#nextbtn").attr('href');
submit_question1(href);
}
else {
$('#recording-status').html("An error occurred");
}
//$("#audio").attr("src", url);
// $("#audio")[0].play();
// alert("Saved In Server. See audio element's src for URL");
}
});
}, "blob");
restore();
}); });