import Recorder from 'js-audio-recorder' export default { data() { return { recorder: null, playTime: 0, timer: null, src: null } }, created() { this.recorder = new Recorder() }, methods: { // 开始录音 handleStart() {
//获取WAV录音数据getWAVRecordAudioData() {varwavBlob =this.recorder.getWAVBlob(); console.log(wavBlob); }, 下载PCB录音文件 //下载PCB录音文件downloadPCBRecordAudioData() {this.recorder.downloadPCM("badao"); }, 下载WAV录音文件 //下载WAV录音文件downloadWAVRecordAudioData() {this.recorder.downloa...
一:安装插件 js-audio-recorder cnpm i js-audio-recorder --s 二:安装将格式转换为mp3的插件 lamejs cnpm install lamejs --s 三:附上实现源码: vue2录音操作功能 <template> <div class="home" style="margin:1vw;"> <Button type="success" @click="getPermission()" style="margin:1vw;">获取...
npm i js-audio-recorder (cnpm和yarn的请适当转换) 2、需要的地方引入 import Recorder from ‘js-audio-recorder’; 3、实例化 let recorder = new Recorder(); 实例化这里可根据自己需求来,也可像我一样整个页面都用,在初识实例化 import Recorder from 'js-audio-recorder'; let recorder = new Recorder...
// 停止录音 stopRecordAudio() { if (this.isrecording) { console.log('停止录音---') this.isrecording = false this.recorder.stop() this.uploadWAVData() } else { console.log('没有需要停止的录音---') } }, // 播放录音 playRecordAudio() { console.log('播放录音') this.recorder.play(...
js-audio-recorder这个库迷人格式是wav,后端只支持mp3,说是用lampjs,一顿操作,报错"ReferenceError: MPEGMode is not defined",查了半天,大多数方案都是编辑文件node_modules/lamejs夹中的相应文件等等,这太不靠谱了。 于是乎我尝试了https://github.com/xiangyuecn/Recorder,导入语句 ...
:before-record="beforeRecord" :after-record="afterRecord" ></vue-audio-recording> </div> </template> ``` 3.处理录音事件 vue-audio-recording组件提供了一些事件,如`beforeRecord`、`afterRecord`等,用于处理录音的相关操作。你可以在Vue组件的方法中定义这些事件的处理函数: ```javascript export default...
Audio recorder for Vue.js. It allows to create, play, download and store records on a server. Live demo Features Beautiful clean UI Download/upload/play record Time limit Records limit A lot of callbacks Individual an audio player MP3 support ...
vue-audio-recorder Audio recorder for Vue.js. It allows to create, play, download and store records on a server. Live demo Features Beautiful clean UI Download/upload/play record Time limit Records limit A lot of callbacks Individual an audio player ...
在main.js中引入这个插件 import vueAudioNative from 'vue-audio-native' Vue.use(vueAudioNative) 1. 2. 页面中的用法: <vue-audio-native :url="msource" :show-current-time="true" :show-controls="false" :show-download="true" :autoplay="false" ...