Skip to content
loop over buffer slices
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md
ex.js
package.json
sloop.js
taex.js

README.md

npm install sloop

loop over a selected portion of a buffer now supports Typed Arrays

    var Sampler = require('./sloop')

    var buf = new Buffer('beepboopbaapboom')
    , start = 0 // buf index to start
    , size = 4 // size of each sample by index count (bytes, for buffers;  indecies for TAs (usually 1))
    , duration = 4 // length of the loop in the above size value
    ;

    sample = Sampler(buf, start, duration, size)

    var t = setInterval(
      function(){
      console.log(sample().toString())
    }, 333)
Something went wrong with that request. Please try again.