Narnia's Psychedelic Mushrooms

    node-crunker

    0.0.4 • Public • Published

    Node-Crunker

    Experimental, use in production with caution

    Simple way to merge, concatenate, play, export and download audio files with the NodseWeb Audio API.

    Installation

    npm install node-crunker

    Usage

    const NodeCrunker = require('node-crunker');
    const audio = new NodeCrunker();

    Merge example

    audio
      .fetchAudio(
        'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata1.mp3',
        'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata4.mp3'
      )
      .then(buffers => audio.mergeAudio(buffers))
      .then(merged => audio.export(merged, 'merged.mp3'))
      .catch(error => {
        console.log(error);
      });

    Local merge example

    audio
      .fetchLocalAudio(
        'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata1.mp3',
        'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata4.mp3'
      )
      .then(buffers => audio.mergeAudio(buffers))
      .then(merged => audio.export(merged, 'merged.mp3'))
      .catch(error => {
        console.log(error);
      });

    Concatenation example

    audio
      .fetchAudio(
        'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata1.mp3',
        'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata4.mp3'
      )
      .then(buffers => audio.concatAudio(buffers))
      .then(merged => audio.export(merged, 'merged.mp3'))
      .catch(error => {
        console.log(error);
      });

    Local concatenation example

    audio
      .fetchAudio(
        'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata1.mp3',
        'http://www.mp3classicalmusic.net/48Music/Chopin48/Ballata4.mp3'
      )
      .then(buffers => audio.concatAudio(buffers))
      .then(merged => audio.export(merged, 'merged.mp3'))
      .catch(error => {
        console.log(error);
      });

    License

    MIT

    Install

    npm i node-crunker

    DownloadsWeekly Downloads

    42

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    18.6 kB

    Total Files

    6

    Last publish

    Collaborators

    • jzarca01