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.0 to 0.3.1

2

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

@@ -6,0 +6,0 @@ "test": "node test.js",

@@ -17,3 +17,3 @@ ToneGenerator for node.js

volume: 30,
sampleRate: 44100,
rate: 44100,
shape: 'triangle'

@@ -23,3 +23,3 @@ })

// The old interface, still available for compatibility
var tonedata = tone(frequency, lengthInSeconds, volume = 30, sampleRate = 44100)
var tonedata = tone(frequency, lengthInSeconds, volume = 30, rate = 44100)
```

@@ -31,9 +31,9 @@

- **volume** controls max/min for the array values. If you intend to write 8-bit it should be less than or equal to tone.MAX_8, if 16 bit it should be less than or equal to tone.MAX_16. *defaults to 30*
- **sampleRate** number of samples per second. Together with lengthInSecs, this define the length of the output array (lengthInSeccs * sampleRate). *defaults to 44100*
- **rate** sample rate, number of samples per second. Together with lengthInSecs, this define the length of the output array (lengthInSeccs * rate). *defaults to 44100*
- **shape** controls the wave shape. Options are *'triangle', 'square', 'sine', 'saw'*. You can also pass in a custom function, see the tests for an example of this. *defaults to 'sine'*
#### Using the old interface
The old interface takes four arguments: *freq, lengthInSecs, volume, sampleRate*.
**volume** and **sampleRate** are optional, the default is shown above.
**Shape is not available in the old interface. If you want to specify sampleRate, you have to specify volume!**
The old interface takes four arguments: *freq, lengthInSecs, volume, rate*.
**volume** and **rate** are optional, the default is shown above.
**Shape is not available in the old interface. If you want to specify rate, you have to specify volume!**

@@ -40,0 +40,0 @@ #### Useful constants

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