import{at as P,au as A}from"./index-93dfb385.js";var v={exports:{}};/*! * * js-audio-recorder - js audio recorder plugin * * @version v1.0.7 * @homepage https://github.com/2fps/recorder * @author 2fps (https://www.zhuyuntao.cn) * @license MIT * */(function(w,b){(function(m,f){w.exports=f()})(P,function(){return function(m){var f={};function p(a){if(f[a])return f[a].exports;var r=f[a]={i:a,l:!1,exports:{}};return m[a].call(r.exports,r,r.exports,p),r.l=!0,r.exports}return p.m=m,p.c=f,p.d=function(a,r,o){p.o(a,r)||Object.defineProperty(a,r,{enumerable:!0,get:o})},p.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},p.t=function(a,r){if(1&r&&(a=p(a)),8&r||4&r&&typeof a=="object"&&a&&a.__esModule)return a;var o=Object.create(null);if(p.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:a}),2&r&&typeof a!="string")for(var t in a)p.d(o,t,(function(n){return a[n]}).bind(null,t));return o},p.n=function(a){var r=a&&a.__esModule?function(){return a.default}:function(){return a};return p.d(r,"a",r),r},p.o=function(a,r){return Object.prototype.hasOwnProperty.call(a,r)},p.p="",p(p.s=1)}([function(m,f,p){function a(r,o,t){for(var n=0;no?o:t,e=d,l=new ArrayBuffer(44+r.byteLength),u=new DataView(l),g=n,c=0;a(u,c,"RIFF"),c+=4,u.setUint32(c,36+r.byteLength,s),a(u,c+=4,"WAVE"),a(u,c+=4,"fmt "),c+=4,u.setUint32(c,16,s),c+=4,u.setUint16(c,1,s),c+=2,u.setUint16(c,g,s),c+=2,u.setUint32(c,i,s),c+=4,u.setUint32(c,g*i*(e/8),s),c+=4,u.setUint16(c,g*(e/8),s),c+=2,u.setUint16(c,e,s),a(u,c+=2,"data"),c+=4,u.setUint32(c,r.byteLength,s),c+=4;for(var y=0;y44&&n.default.play(e.buffer)},i.prototype.getPlayTime=function(){return n.default.getPlayTime()},i.prototype.pausePlay=function(){!this.isrecording&&this.isplaying&&(this.isplaying=!1,this.onpauseplay&&this.onpauseplay(),n.default.pausePlay())},i.prototype.resumePlay=function(){this.isrecording||this.isplaying||(this.isplaying=!0,this.onresumeplay&&this.onresumeplay(),n.default.resumePlay())},i.prototype.stopPlay=function(){this.isrecording||(this.isplaying=!1,this.onstopplay&&this.onstopplay(),n.default.stopPlay())},i.prototype.destroy=function(){return n.default.destroyPlay(),this.destroyRecord()},i.prototype.getRecordAnalyseData=function(){return this.getAnalyseData()},i.prototype.getPlayAnalyseData=function(){return n.default.getAnalyseData()},i.prototype.getPCM=function(){this.stop();var e=this.getData();return e=t.compress(e,this.inputSampleRate,this.outputSampleRate),t.encodePCM(e,this.oututSampleBits,this.littleEdian)},i.prototype.getPCMBlob=function(){return new Blob([this.getPCM()])},i.prototype.downloadPCM=function(e){e===void 0&&(e="recorder");var l=this.getPCMBlob();o.downloadPCM(l,e)},i.prototype.getWAV=function(){var e=this.getPCM();return t.encodeWAV(e,this.inputSampleRate,this.outputSampleRate,this.config.numChannels,this.oututSampleBits,this.littleEdian)},i.prototype.getWAVBlob=function(){return new Blob([this.getWAV()],{type:"audio/wav"})},i.prototype.downloadWAV=function(e){e===void 0&&(e="recorder");var l=this.getWAVBlob();o.downloadWAV(l,e)},i.prototype.download=function(e,l,u){o.download(e,l,u)},i.prototype.getChannelData=function(){var e=this.getPCM(),l=e.byteLength,u=this.littleEdian,g={left:null,right:null};if(this.config.numChannels===2){var c=new DataView(new ArrayBuffer(l/2)),y=new DataView(new ArrayBuffer(l/2));if(this.config.sampleBits===16)for(var h=0;h