-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a volume parameter, setup semantic release
- Loading branch information
1 parent
6778b3d
commit 3802068
Showing
6 changed files
with
65 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: node_js | ||
node_js: | ||
"node" | ||
cache: | ||
directories: | ||
- node_modules | ||
after_success: | ||
- npm run semantic-release | ||
branches: | ||
except: | ||
# ignore git tags created by semantic-release, like "v1.2.3" | ||
- /^v\d+\.\d+\.\d+$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
{ | ||
"name": "tonegenerator", | ||
"description": "Generates a tone as raw PCM WAV data, so you can do operations on it", | ||
"version": "0.0.2", | ||
"version": "0.0.0-semantically-released", | ||
"scripts": { | ||
"test": "node test.js", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"author": { | ||
"name": "Karl Westin", | ||
"email": "[email protected]" | ||
}, | ||
"repository" : { | ||
"type" : "git", | ||
"url" : "https://github.com/karlwestin/node-tonegenerator.git" | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/karlwestin/node-tonegenerator.git" | ||
}, | ||
"keywords": [ | ||
"audio", | ||
"tone", | ||
"frequency", | ||
"wav", | ||
"pcm" | ||
], | ||
"devDependencies": { | ||
"semantic-release": "^4.3.5" | ||
}, | ||
"keywords": ["audio", "tone", "frequency", "wav", "pcm"], | ||
"dependencies": {}, | ||
"main": "./index.js", | ||
"readmeFilename": "README.md" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var assert = require('assert') | ||
var tonegenerator = require('./') | ||
|
||
console.log('Testing Tonegenerator...') | ||
|
||
|
||
var tone1 = tonegenerator(440, 2, 10) | ||
var tone2 = tonegenerator(440, 2, 30) | ||
|
||
assert(Array.isArray(tone1), 'Data is an array') | ||
|
||
assert.strictEqual(Math.max.apply(Math, tone1), 10, 'takes the volume argument as max') | ||
assert.strictEqual(Math.min.apply(Math, tone1), -10, 'takes the volume argument as max') | ||
|
||
assert.strictEqual(Math.max.apply(Math, tone2), 30, 'takes the volume argument as max') | ||
|
||
console.log('...done') |