@lodestream/waveform-samples-generator
This is a thin wrapper around [audiowaveform](https://github.com/bbc/audiowaveform) to parse audio files and generate sample data.
Last updated a year ago by rankun203 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @lodestream/waveform-samples-generator 
SYNC missed versions from official npm registry.

Waveform Samples Generator Build Status

This is a thin wrapper around audiowaveform to parse audio files and generate sample data.

If you want more features or generate them on your own, just use the original audiowaveform and waveform-data.js.

Installation

  1. REQUIRED: Follow this guide to install audiowaveform binary into your system.
  2. Install this module:
npm install @lodestream/waveform-samples-generator
  1. Use it like this:
const { parseFile } = require("@lodestream/waveform-samples-generator");

const start = async () => {
  const samples = await parseFile({ 
    // filePath: "./audio.mp3",
    url: "https://cdn.jsdelivr.net/gh/lodestreams/waveform-samples-generator@2254b8235c0cd82a482fb2bf7b7404c8fb0df560/docs/test.mp3"
    sampleRate: 10
  });
  // See /src/@types/waveform-data/index.d.ts for detailed schema of `samples`
  console.log(JSON.stringify(samples.max));
};

start();

If your want to draw waveforms out of it, use samples.max, it's an array of points.

Play with this repo

Print out samples (array):

ts-node --files src/scripts/parser.manual.ts
# [2,2,2,3,2,2,3,2,3,2,3,3,3,5,4,4,4,2,...

Play the waveform! Watch it dancing!

ts-node --files src/scripts/player.manual.ts

Current Tags

  • 1.0.12                                ...           latest (a year ago)

10 Versions

  • 1.0.12                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 10
This Month 11
Last Day 0
Last Week 1
Last Month 4
Dependencies (15)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |