Real-Time Noise Suppression with Mobile AI

This article provides a detailed guide on how to implement real-time noise suppression for Android using ONNX Runtime Mobile, with performance recommendations and strategies to reduce APK size. Ideal for mobile developers and AI engineers looking to integrate

jueves, 14 de agosto de 2025 • 4 min read • Q2BSTUDIO Team

Artificial-Intelligence-

Introduction: in this article we explain how to build real-time noise suppression for Android using ONNX Runtime Mobile, with functional code, performance recommendations, and strategies to reduce APK size by up to 70 percent. This guide is intended for mobile developers, AI engineers, and product teams looking to integrate robust and efficient artificial intelligence into their custom applications.

What real-time noise suppression does: noise suppression removes unwanted sounds from an audio signal while the input continues, keeping latency low for calls, recordings, or voice assistants. By combining an optimized ONNX model, native audio processing, and efficient inference techniques, we achieve quality and efficiency on Android devices.

Prerequisites and tools: Android Studio, NDK, Kotlin or Java, ONNX Runtime Mobile, a trained noise suppression model exported to ONNX, audio libraries such as Oboe or AudioRecord, and tools for model quantization and pruning. For enterprise deployments, we recommend AWS and Azure cloud services for training and managing models and CI/CD pipelines.

Model selection and preparation: choose a model specialized in source separation or noise suppression that can run in real time. Consider small architectures such as RNNoise, RNN models, or convolution-based models with short windows. Export to ONNX and apply 8-bit integer quantization and graph optimizations. Useful techniques: post-training quantization, pruning of low-importance parameters, and layer fusion. These optimizations reduce latency and binary size.

ONNX Runtime Mobile integration in Android: add ONNX Runtime Mobile as a native dependency and use the C API to instantiate inference sessions from Kotlin or Java via JNI. Initialize the session once and reuse it. Avoid creating and destroying sessions for each frame. Enable accelerators such as NNAPI or GPU when available to improve performance on compatible devices.

Audio pipeline: capture audio with low latency using Oboe or AudioRecord in low-latency mode. Process in fixed-size blocks, for example 20 to 40 ms. For each block, convert to the representation expected by the model, apply windows and normalization, run ONNX inference, and reconstruct the output signal with overlap and inverse windowing. Keep a dedicated audio thread and use lock-free queues to pass buffers to the inference thread.

General execution structure: 1 capture audio on the audio thread 2 copy buffer to queue 3 inference thread takes buffer and runs preprocessing 4 run ONNX Runtime session 5 post-process output and return to playback. Avoid heavy memory operations on the audio thread and prioritize operations on inference threads and thread pools.

High-level pseudocode example: span Capture audio with Oboe or AudioRecord and push buffers to a queue span Initialize ONNX Runtime Mobile and load optimized ONNX session span Inference thread: take buffer, convert to model format, run session run, convert output to PCM, send to audio player

Performance tips: minimize memory copies, use direct native buffers, preallocate memory, run inference on separate threads, leverage NNAPI or GPU delegates when possible, use quantization and reduce model precision. Measure end-to-end latency and use Android Studio profiling tools and Perfetto. For devices with limited CPU, consider lighter models or reducing the sampling rate with efficient upsampling algorithms.

APK size reduction: use ONNX Runtime Mobile built with only the necessary architectures, remove debug symbols, use split APKs by ABI, package optimized and quantized models, enable resource compression, and consider dynamic model loading from the cloud to avoid embedding them in the APK. Combining quantization, pruning, and removing unnecessary native libraries can achieve a reduction of up to 70 percent in the final APK size.

Testing and validation: test on a wide variety of real devices, measure audio quality with perceptual metrics and tests with real users. Evaluate CPU consumption, memory usage, temperature, and battery to ensure noise suppression is viable in real-world scenarios.

Security and deployment considerations: protect the model and audio data with encryption at rest and in transit. Integrate cybersecurity practices to control access and logs. For enterprise deployments, we recommend integrating pipelines into AWS and Azure cloud services with model management, monitoring, and secure updates.

How Q2BSTUDIO can help: at Q2BSTUDIO we are experts in software development and custom applications, with experience in artificial intelligence, cybersecurity, AWS and Azure cloud services, business intelligence services, and AI solutions for enterprises. We offer comprehensive services from initial consulting, custom software development, and model optimization to integrations with AI agents, Power BI solutions, and secure cloud deployments. We can help adapt this project to your requirements, create efficient implementations, and deliver a production-ready solution.

Keywords and positioning: custom applications, custom software, artificial intelligence, cybersecurity, AWS and Azure cloud services, business intelligence services, AI for enterprises, AI agents, Power BI. Use these capabilities to improve user experience, reduce operational costs, and accelerate AI adoption in mobile products.

Summary and next steps: prepare and optimize an ONNX model, integrate ONNX Runtime Mobile in Android, design a low-latency audio pipeline, and apply size and performance optimizations. Contact Q2BSTUDIO for a free evaluation, proof of concept, or custom development that integrates real-time noise suppression into your mobile application with best practices in performance and security.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.