https://github.com/sdesalas/cordova-plugin-tonegenerator
A tone generation plugin for cordova apps.
https://github.com/sdesalas/cordova-plugin-tonegenerator
Last synced: 17 days ago
JSON representation
A tone generation plugin for cordova apps.
- Host: GitHub
- URL: https://github.com/sdesalas/cordova-plugin-tonegenerator
- Owner: sdesalas
- License: mit
- Created: 2016-04-08T13:44:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-11T15:36:06.000Z (about 9 years ago)
- Last Synced: 2025-03-30T05:41:21.799Z (about 1 month ago)
- Language: Java
- Homepage:
- Size: 72.3 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

An arbitrary tone generation plugin for cordova apps.
It generates raw tones at specific frequencies and amplitudes, this can be used to produce an interactive pitch response to various user actions, or to generate an electrical waveform through the headphone output jack to drive low-power AC electrical motors.
See [this page](https://github.com/sdesalas/cordova-magnetometer-app/blob/master/www/index.html) for a basic sample cordova app using this plugin.
Installation
------------
cordova plugin add https://github.com/sdesalas/cordova-plugin-tonegenerator
Methods
-------
- cordova.plugins.tonegenerator.play
- cordova.plugins.tonegenerator.frequency
- cordova.plugins.tonegenerator.volume
- cordova.plugins.tonegenerator.stopcordova.plugins.tonegenerator.play()
-------------------------------------------Starts playing a tone.
cordova.plugins.tonegenerator.play(frequency [, amplitude] [, waveType])Default values as follows:
- volume: 127 (50%, max is 255)
- waveType: 0 (Sine Wave)Currently, only Sine Waves are supported.
cordova.plugins.tonegenerator.frequency()
-------------------------------------------Sets the frequency of the generated tone (in Hertz). The human audible range is 60hz to 16,000hz.
This method can be used to update the frequency while a tone is playing.
cordova.plugins.tonegenerator.frequency(hertz)cordova.plugins.tonegenerator.volume()
-------------------------------------------Sets the volume (amplitude) of the generated tone. This should be a value between 0 and 255.
This method can be used to update the volume while a tone is playing.
cordova.plugins.tonegenerator.volume(volume)cordova.plugins.tonegenerator.stop()
--------------------------------Stops playing the generated tone.
cordova.plugins.tonegenerator.stop()Supported Platforms
-------------------- iOS (TODO)
- Android