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

tonegenerator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tonegenerator - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

16

index.js

@@ -68,6 +68,11 @@ /*

var cycles = samplesLeft/cycle;
var ret = [];
const ret = new Int16Array(samplesLeft);
let retIndex = 0;
for(var i = 0; i < cycles; i++) {
ret = ret.concat(generateCycle(cycle, volume, shape));
const cycleValues = generateCycle(cycle, volume, shape);
cycleValues.forEach((value) => {
ret[retIndex++] = value;
});
}

@@ -89,3 +94,8 @@

return generateWaveForm(opts)
const data = generateWaveForm(opts)
if (opts.Int16Array) {
return data
}
return Array.from(data)
}

@@ -92,0 +102,0 @@

4

package.json
{
"name": "tonegenerator",
"description": "Generates a tone as raw PCM WAV data, so you can do operations on it",
"version": "0.3.2",
"version": "0.3.3",
"scripts": {

@@ -29,2 +29,2 @@ "test": "node test.js",

"readmeFilename": "README.md"
}
}

@@ -18,3 +18,4 @@ ToneGenerator for node.js

rate: 44100,
shape: 'triangle'
shape: 'triangle',
Int16Array: true // use this mode when generating very long notes
})

@@ -21,0 +22,0 @@

@@ -6,3 +6,2 @@ var assert = require('assert')

var tone1 = tonegenerator({ freq: 440, lengthInSecs: 2, volume: 10 })

@@ -87,2 +86,15 @@ var tone2 = tonegenerator({ freq: 440, lengthInSecs: 2, volume: 30 })

console.log('Testing generating a 30 minute tone')
var long = tonegenerator({
freq: 440,
lengthInSecs: 30 * 60,
volume: 60,
Int16Array: true
})
assert.equal(long instanceof Int16Array, true, 'Should have an Int16Array mode')
long = null
console.log('...done')
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