javascript - operation is not supported - readAsArrayBuffer -


i trying convert blob data arraybuffer. so, using filereader,but getting error "operation not supported".

var audioctx = new(window.audiocontext || window.webkitaudiocontext)();   navigator.mediadevices.getusermedia({audio: true}).then(function      onsuccess(stream) {       debugger;       rec = new mediarecorder(stream);       rec.ondataavailable = function(e) {           audiochunks.push(e.data);       };       rec.onstart = function(e) {           audiochunks = [];       }       rec.onstop = function(e) {           var blobdata = new blob(audiochunks, {               type: 'audio/x-l16'           });           debugger;           var reader = new filereader();           reader.onload = function() {               audioctx.decodeaudiodata(reader.result, function(buffer) {                   resample(buffer, 16000, function(newbuffer) {                       debugger;                       var arraybuffer =              convertfloat32toint16(newbuffer.getchanneldata(0));                   });               });           };           reader.readasarraybuffer(blobdata);       }   }).   catch (e = > console.log(e)); 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -