hopefuturehu / frequency-player

Emitting sounds of user-specified frequencies

Home Page:https://www.huanlezhang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Emitting sounds of user-specified frequencies

https://www.huanlezhang.com

License:MIT License


Languages

Language:Java 100.0%