0
HIII每個人都玩一次,自動記錄,並允許使用JQuery
Below is the sample code for record.
<html>
<body>
<audio controls autoplay></audio>
<input onclick="startRecording()" type="button" value="start recording" />
<input onclick="stopRecording()" type="button" value="stop recording and play" />
<script>
var onFail = function(e) {
console.log('Rejected!', e);
};
var onSuccess = function(s) {
stream = s;
}
window.URL = window.URL || window.webkitURL;
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
var stream;
var audio = document.querySelector('audio');
function startRecording() {
if (navigator.getUserMedia) {
navigator.getUserMedia({audio: true}, onSuccess, onFail);
} else {
console.log('navigator.getUserMedia not present');
}
}
function stopRecording() {
audio.src = window.URL.createObjectURL(stream);
}
</script>
</body>
</html>
我想要做的就是setInterval的40秒鐘,將40秒緩衝像錄音將在40秒計時器啓動後40秒將運行它會顯示播放按鈕,檢查音頻recorded.Below我又增加了樣品截圖
進度條會顯示recording..Similarly會有音頻存在一些問題,我需要開始play.If有人知道這個問題的解決方案,請幫助me.Thanks烏拉圭回合支持
顯示一次記錄音頻完整一些錯誤@karthikeyan –
和錄音工作不正常@karthikeyan –
@KavyaShree'顯示一些錯誤','不正常工作'沒有幫助解決問題。提及你得到的錯誤 –