Expo May 14, 2025

Real-time audio processing with Expo and native code

Article Summary

Braulio Ríos built a production-ready guitar tuner app using React Native that processes audio in real-time with near-native performance. Here's how he combined TypeScript, C++, Swift, and Kotlin to solve a problem most developers think requires going fully native.

Tuneo is an open-source guitar tuner that showcases React Native's New Architecture by implementing real-time pitch detection. The app uses TurboModules for C++ audio processing, custom Expo modules for microphone access, and adaptive algorithms calibrated through Python notebooks to handle the complexity of tracking fading guitar notes.

Key Takeaways

Critical Insight

React Native's New Architecture enables real-time audio processing by letting developers orchestrate in TypeScript while executing performance-critical code in C++, Swift, and Kotlin without bridge bottlenecks.

The article includes side-by-side spectrograms showing exactly how the adaptive strategy prevents the algorithm from jumping to harmonics as notes fade.

About This Article

Problem

Braulio Ríos wanted to build a guitar tuner that needed low-latency microphone access and real-time pitch detection. React Native made this difficult because sending large audio buffers across the bridge caused serialization overhead.

Solution

He built a hybrid architecture using TurboModules to run C++ pitch detection with the YIN algorithm. For direct microphone hardware access, he wrote custom Expo Native Modules in Swift and Kotlin. This approach eliminated the JSON serialization bottlenecks that were slowing things down.

Impact

The adaptive parameter strategy worked by narrowing frequency search ranges and relaxing thresholds as notes fade. This produced stable pitch detection that locked onto fundamental frequencies instead of jumping erratically to harmonics. He validated the approach using Python spectrograms before implementing it in C++.