Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-wav

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-wav - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

tests/file1.wav

16

index.js

@@ -147,9 +147,17 @@ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */

function decode(buffer) {
// typed arrays and Buffer both have an array buffer as .buffer property
if (buffer.buffer)
let pos = 0, end = 0;
if (buffer.buffer) {
// If we are handed a typed array or a buffer, then we have to consider the
// offset and length into the underlying array buffer.
pos = buffer.byteOffset;
end = buffer.length;
buffer = buffer.buffer;
} else {
// If we are handed a straight up array buffer, start at offset 0 and use
// the full length of the buffer.
pos = 0;
end = buffer.byteLength;
}
let end = buffer.byteLength;
let v = new DataView(buffer);
let pos = 0;

@@ -156,0 +164,0 @@ function u8() {

{
"name": "node-wav",
"version": "0.0.1",
"version": "0.0.2",
"description": "High performance WAV file decoder and encoder",
"main": "./index.js",
"scripts": {
"test": "./node_modules/nodeunit/bin/nodeunit ./test.js"
"test": "./node_modules/nodeunit/bin/nodeunit ./tests/test.js"
},

@@ -9,0 +9,0 @@ "repository": {

@@ -1,11 +0,12 @@

'use strict';
let fs = require('fs');
let wav = require('./index');
let buffer = fs.readFileSync('file.wav');
let result = wav.decode(buffer);
console.log(result.sampleRate);
console.log(result.channelData); // array of Float32Arrays
//let files = JSON.parse(fs.readFileSync('x.json'));
wav.encode(result.channelData, { sampleRate: result.sampleRate, float: true, bitDepth: 32 });
let files = ["../train/data//other/0005932e-db17-4a21-b99f-5e10f84a9e74.wav"];
files.forEach(file => {
console.log(file);
let buffer = fs.readFileSync(file);
let w = wav.decode(buffer);
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc