Code Monkey home page Code Monkey logo

lsdj-wave-cruncher's People

Contributors

ilambda avatar urbster1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lsdj-wave-cruncher's Issues

Auto-detect wav frequency

I just tested this and it seems doable to add a method to auto-detect the frequency of a wav file. This was the code I used and it requires fs, node-wav, and pitchfinder

const fs = require("fs");
const wav = require("node-wav");
const Pitchfinder = require("pitchfinder");
 
// see below for optional constructor parameters. 
const detectPitch = new Pitchfinder.YIN();
 
const buffer = fs.readFileSync("PATH_TO_WAV");
const decoded = wav.decode(buffer); // get audio data from file using `wav-decoder` 
const float32Array = decoded.channelData[0]; // get a single channel of sound 
const pitch = detectPitch(float32Array); // null if pitch cannot be identified
console.log("Frequency detected: " + parseFloat(pitch) + " Hz")

Create a unix-friendly bin

The API should be installable using npm and runnable as a command line :

$ lsdjcrunch crunch ...options
$ lsdjcrunch patch ...options
$ lsdjcrunch crunch-patch ...options
$ lsdjcrunch export ...options

Also, commands should have a --output or -o option for the output file. If not provided, the output file should be piped to stdout

const output = (file: Stream, options) {
  file
    .pipe(options.output ? fs.createWriteStream(options.output) : process.stdout)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.