Repolode
AhmadHassan-BTed

AhmadHassan-BTed/AhSilence

An Android active noise cancellation engine in Kotlin that detects low-frequency hums with FFT and plays phase-inverted audio to cancel them.

Stars
1,684
Forks
2
Open issues
5
Last commit
last month

What is it?

AhSilence is a native Android active noise cancellation (ANC) app built with Jetpack Compose and Kotlin. It targets persistent low-frequency sounds such as AC units or electrical drones. The app records ambient audio, runs a custom Cooley-Tukey radix-2 FFT to find the dominant frequency, and then emits an inverted sine wave so the two waves interfere destructively.

Users can adjust the phase offset with a 360-degree calibration dial to compensate for hardware or Bluetooth latency, and set amplitude with a gain slider. A Pro mode exposes these controls, while a Simple mode offers a reduced interface. Cancellation runs in a foreground service with a persistent notification, so it keeps working when the screen is locked.

The project follows Clean Architecture, with a Kotlin-only domain layer isolated from Android framework code. The project notes that it works fully offline without network calls or telemetry. It requires a physical Android device with a microphone, since emulators do not support the low-latency audio testing it needs. Minimum supported version is Android 8.0 (API 26).

Key features

  • 01Detects the dominant low-frequency hum from microphone audio using a custom radix-2 FFT.
  • 02Plays phase-inverted sine waves to cancel the detected frequency.
  • 03360-degree phase dial to compensate for hardware or Bluetooth latency.
  • 04Amplitude gain slider with Pro and Simple interface modes.
  • 05Foreground service keeps cancellation running while the screen is locked.
  • 06Fully offline, with no network calls or telemetry.

Use cases

  • Reducing a constant air conditioner or fan hum while sleeping or working.
  • Studying how FFT-based frequency detection and anti-phase audio work on Android.
  • Reference implementation of Clean Architecture in a real-time audio Android app.

Quick start

  1. 1

    Clone the repository

    git clone https://github.com/ahmadhassan-bted/ahsilence.git
  2. 2

    Enter the project folder

    cd ahsilence
  3. 3

    Build the debug APK

    ./gradlew clean assembleDebug
  4. 4

    Install on a connected physical Android device

    ./gradlew installDebug

Things to know

  • Requires a physical Android device; emulators are not supported for microphone FFT testing.
  • Requires Android Studio Ladybug or newer and JDK 21+ to build.
  • Targets Android 8.0 (API 26) and above only.
  • Only handles persistent low-frequency hums; multi-frequency and adaptive cancellation are still on the roadmap.

Topics

FAQ

What is AhSilence?
An Android active noise cancellation engine in Kotlin that detects low-frequency hums with FFT and plays phase-inverted audio to cancel them. AhSilence is a native Android active noise cancellation (ANC) app built with Jetpack Compose and Kotlin. It targets persistent low-frequency sounds such as AC units or electrical drones. The app records ambient audio, runs a custom Cooley-Tukey radix-2 FFT to find the dominant frequency, and then emits an inverted sine wave so the two waves interfere destructively.
Is AhSilence free to use? What license does it have?
AhSilence is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is AhSilence still maintained?
Updated within 6 months. The last commit to AhSilence was on Sep 15, 2026.
What can I use AhSilence for?
Reducing a constant air conditioner or fan hum while sleeping or working. Studying how FFT-based frequency detection and anti-phase audio work on Android. Reference implementation of Clean Architecture in a real-time audio Android app.
How do I install AhSilence?
Clone the repository: git clone https://github.com/ahmadhassan-bted/ahsilence.git Enter the project folder: cd ahsilence Build the debug APK: ./gradlew clean assembleDebug Install on a connected physical Android device: ./gradlew installDebug
Where can I get AhSilence?
The source code and installation instructions are on GitHub: https://github.com/AhmadHassan-BTed/AhSilence

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects