(Screenshot from Huawei Mate 20)
For a web application that has the similar functionality, please refer to my dtc-web-audio-frequency
There are three ways to specify the frequency
- type in the frequency
- use the slide bar
- automatically change the frequency range
The interface to the phone speaker is the PlaySound
class. The supported frequency of sounds is from 1 Hz to 24k Hz.
-
play sound
PlaySound mPlaySound = new PlaySound(); mPlaySound.mOutputFreq = your_frequency; mPlaySound.start();
You can change
mPlaySound.mOutputFreq
during the sound playing -
stop
if (mPlaySound != null) { mPlaySound.stop(); mPlaySound = null; }
- Huawei Mate 20
- Google Pixel 2