這篇文章主要介紹JavaScript修改音頻的采樣率的方法,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
js音頻修改采樣率sampleRate,self.onmassage的switch,github上鏈接為:本地運(yùn)行接口跨域,請?jiān)诿钚休斎?open-n/Applications/Google\Chrome.app/--args--disable-web-security--user-atadir=/Users/UserName/MyChromeDevUserData/(UserName為電腦用戶名),可調(diào)用起可跨域谷歌瀏覽器。
samplerate調(diào)用,開始錄音
navigator.mediaDevices.getUserMedia(constraints).then(function(stream){ console.log("getUserMedia()success,streamcreated,initializingRecorder.js..."); $("#recordButton").removeClass("stop"); $("#stopButton").addClass("recoding"); $(".errorTips").removeClass("errorShow"); $(".refresh").removeClass("refreshShow"); audioContext=newAudioContext(); samplerate結(jié)束錄音–將獲取的音頻轉(zhuǎn)換采樣率 functionstopRecording(){ console.log("stopButtonclicked"); $("#recordButton").addClass("stop"); $("#stopButton").removeClass("recoding"); //telltherecordertostoptherecording rec.stop(); //stopmicrophoneaccess gumStream.getAudioTracks()[0].stop(); //createthewavblobandpassitontocreateDownloadLink //音頻.exportWAV(回調(diào)函數(shù),音頻type,需要的采樣率) rec.exportWAV(createDownloadLink,"audio/wav",Number(recRate));
以上是“JavaScript修改音頻的采樣率的方法”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)站標(biāo)題:JavaScript修改音頻的采樣率的方法-創(chuàng)新互聯(lián)
當(dāng)前地址:http://www.rwnh.cn/article30/jospo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPT、自適應(yīng)網(wǎng)站、面包屑導(dǎo)航、網(wǎng)站營銷、用戶體驗(yàn)、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容