Giter Site home page Giter Site logo

taku-o / wav-fmt-validator Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 416 KB

wav audio file format validator library for unit test.

Home Page: https://www.npmjs.com/package/wav-fmt-validator

JavaScript 53.30% TypeScript 46.70%
wav audio javascript node validator

wav-fmt-validator's Introduction

wav-fmt-validator

description

wav audio file format validator library for unit test.

install

npm install --save wav-fmt-validator

validator library

validate wav audio file format example on unit test.

var assert = require('assert');
var fs = require('fs');
var wavValidator = require('wav-fmt-validator').validator;

var wavPath = ...

fs().readFile(wavPath, 'binary', (err, content) => {
  assert.ok(!err);
  var wavBuffer = Buffer.from(content, 'binary');
  assert.ok(wavValidator(wavBuffer));
});

get wav audio file information.

var fs = require('fs');
var wavParser = require('wav-fmt-validator').parser;

var wavPath = ...

fs().readFile(wavPath, 'binary', (err, content) => {
  if (err) {
    return;
  }
  var wavBuffer = Buffer.from(content, 'binary');
  console.log(wavParser(wavBuffer));
});

command

wav-parse command.

simply command to parse, and display wav file information.

wav-parse wav-file.wav

this command will display wav info.

position  length  header                data  
--------  ------  --------------------  ------
0         4       Chunk ID "RIFF"       RIFF  
4         4       Chunk Size            239982
8         4       Format "WAVE"         WAVE  
12        4       Subchunk1 ID "fmt "   fmt   
16        4       Subchunk1 Size        16    
20        2       Audio Format "1" PCM  1     
22        2       Num Channels          1     
24        4       Sample Rate           44100 
28        4       Byte Rate             88200 
32        2       Block Align           2     
34        2       Bits Per Sample       16    
36        4       Subchunk2 ID "data"   data  
40        4       Subchunk2 Size        239946
44        239946  Wave Data             ******

wav-fmt-validator's People

Contributors

taku-o avatar

Watchers

 avatar James Cloos avatar

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.