Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.38 KB

README.md

File metadata and controls

42 lines (31 loc) · 1.38 KB

An Android app that emits sounds of user-specified frequencies

License: MIT   Codacy Badge

Huawei Mate 20

(Screenshot from Huawei Mate 20)

For a web application that has the similar functionality, please refer to my dtc-web-audio-frequency

Instructions

There are three ways to specify the frequency

  • type in the frequency
  • use the slide bar
  • automatically change the frequency range

Source Code

The interface to the phone speaker is the PlaySound class. The supported frequency of sounds is from 1 Hz to 24k Hz.

  1. play sound

    PlaySound mPlaySound = new PlaySound();
    mPlaySound.mOutputFreq = your_frequency;
    mPlaySound.start();

    You can change mPlaySound.mOutputFreq during the sound playing

  2. stop

    if (mPlaySound != null) {
        mPlaySound.stop();
        mPlaySound = null;
    }

Phones Tested

  • Huawei Mate 20
  • Google Pixel 2