How to use crunker - 2 common examples

To help you get started, we’ve selected a few crunker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github syntithenai / opensnips / snips-react-satellite / src / SnipsLogger.js View on Github external
Promise.all(promises).then(function(allBuffers) {
                let merger =  new Crunker();
                try {
                    let output = merger.export(merger.concatAudio(allBuffers), "audio/wav");
                    that.updateSession(payload,function(session) {
                             if (!session.audio) session.audio=[];
                             that.blobToDataUrl(output.blob).then(function(dataUrl) {
                                session.audio.push(dataUrl);               
                                // start again
                                that.resetAudioBuffer(siteId); 
                                that.setLogData();
                             });                         
                             return session;
                    });                
                } catch (e) {
                    console.log(e.message);
                }
            });
github sascharissling / fiddle / client / src / components / pages / Consolidation.js View on Github external
React.useEffect(() => {
    if (crunkerRef.current) {
      let audio = new Crunker();
      audio
        .fetchAudio(oldAudioFileUrl, newAudioFileUrl)
        .then(buffers => audio.mergeAudio(buffers))
        .then(merged => audio.export(merged, 'audio/wav'))
        .then(output => {
          const file_reader = new FileReader();
          const dateOfRecording = Date.now();
          file_reader.readAsDataURL(output.blob);
          file_reader.onloadend = async function() {
            const base64_string = file_reader.result;
            uploadAudio(base64_string, author, chatId, dateOfRecording);
            return base64_string;
          };
          setConsolidatedAudioFileName(`${chatId}-${dateOfRecording}-${author}.webm`);
          setTimeout(() => setConsolidationDone(true), 1500);
        })

crunker

Simple way to merge or concatenate audio files with the Web Audio API.

MIT
Latest version published 11 months ago

Package Health Score

61 / 100
Full package analysis

Popular crunker functions