sdesalas / cordova-plugin-tonegenerator

A tone generation plugin for cordova apps.
MIT License
4 stars 1 forks source link

Help with using Tone Generator #1

Open sdesalas opened 8 years ago

sdesalas commented 8 years ago

Hello Steven, How are you?

I am trying to use your helpful plugin, the tonegenerator, but its seems to create wrong sounds for the frequencies.

To check this, I created an app which generate sounds from 0 to 20,000 using the plugin, and its going up and down, up and down, you can see it in the attached movie.

While he should go just up, like this movie: https://www.youtube.com/watch?v=H-iCZElJ8m0

Do you have an idea what am i doing wrong?

My code is very simple, you can see it below

Thank you very much for your help! Tomer Zarfati

    var intFreq = -1;
    $("#playBtnTest4").click(function () {
            intFreq = 0;
            $("#firstFrequency").val(intFreq);
            cordova.plugins.tonegenerator.play(intFreq);
            DisplayStairs();
    });

    function DisplayStairs()
    {      
            if (intFreq >= 20000 || intFreq == -1) {
                intFreq = 0;
                return;
            }
            intFreq += 100;
            $("#firstFrequency").val(intFreq);
            cordova.plugins.tonegenerator.frequency(intFreq);
            window.setTimeout(function () { DisplayStairs(); }, 100)
    }
sdesalas commented 8 years ago

Hi Tomer,

Thanks I've been meaning to give the tone generator some more TLC. Glat to hear someone is using it out there besides me!

Will take a look at your problem this weekend.

Cherio, Steven

nipungarg6138 commented 7 years ago

how to generate 200hz sound? cordova.plugins.tonegenerator.play(200)

or cordova.plugins.tonegenerator.play(frequency(200))