html5 ajax content-panel,Sending HTML5 audio element content to ajax POST

I'm trying to give my users a way to record audio files and post them to my server. I'm using Recorder.js for the recording part, and I can have an element populated by the user's (webrtc) recording as a blob generated by the javascript library. I am able to record and download the recording, just like on this demo: http://webaudiodemos.appspot.com/AudioRecorder/index.html

Question is, instead of downloading the file, how could I include this recording into a jQuery ajax post? Goal is to post the recording along with some data on a and the receiving server would save the data into a database and the recording file onto its disk.

audioRecorder && audioRecorder.exportWAV(function (blob) {

//Here we get the blob object url, which can be set as audio element source

var url = URL.createObjectURL(blob);

//Here we download the recording file

audioRecorder.forceDownload(blob, 'output.wav');

//I can set the audio element for pre-listening before user POSTs the form

var au = $('#myaudioelement').attr("src",url);

});

So when the user sends the ajax POST, I'd need to add the content of 'myaudioelement' to the data field in the $.ajax call, along with something like value of , how can I accomplish this?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值