Coder Social home page Coder Social logo

nisrulz / zentone Goto Github PK

View Code? Open in Web Editor NEW
114.0 8.0 28.0 2.88 MB

:sound: [Android Library] Easily generate audio tone of a specific frequency and volume in Android.

Home Page: http://nisrulz.github.io/zentone

License: Apache License 2.0

Kotlin 87.42% Shell 12.58%
android library audio tone frequency sinewave

zentone's Issues

Remove Duration

What a wonderful library. Very easy to use. kudos

Just a suggestion, can we remove the duration? We will just generate the tune on MotionEvent.ACTION_DOWN and stop the tune until the user unpressed the button (MotionEvent.ACTION_UP).

`  findViewById(R.id.play_tune_button).setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (motionEvent.getAction() == MotionEvent.ACTION_DOWN){
                Log.w("Pressed", "Button ACTION_DOWN1");               
                generateSound(261);
            }

            else if (motionEvent.getAction() == MotionEvent.ACTION_UP){
                Log.w("Pressed", "Button ACTION_UP1");
                stopSound();
            }
            return false;
        }
    });`

Duration in ms?

Is there any way i could set the duration of the playback to milliseconds?

Can't generate two frequency at the same

Can't generate two tone frequency at the same time

ZenTone.getInstance().generate(300, 2, 0.5f, toneStoppedListener());

ZenTone.getInstance().generate(500, 2, 0.5f, toneStoppedListener());

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.