On-Device Speech Transcription in React Native with Apple SpeechAnalyzer

Following our recent announcements on on-device LLM support and text embeddings, we are excited to expand our on-device AI capabilities for React Native developers.

Today, we are introducing support for speech transcription, powered by Apple's latest speech recognition frameworks.

import { experimental_transcribe as transcribe } from 'ai'

const response = await transcribe({
  model: apple.transcriptionModel(),
  audio,
})

To get started, install the latest version of the @react-native-ai/apple package:

npm install @react-native-ai/apple@latest

Under the Hood: Apple's SpeechAnalyzer Framework

Apple's speech recognition system, introduced in iOS 26, is built around the new SpeechAnalyzer class, part of the Speechframework. This API introduces a modular approach to audio analysis, enabling developers to configure specific capabilities based on the needs of their application.

Modules are attached to the SpeechAnalyzer to perform targeted tasks. In iOS 26, two modules are available: SpeechTranscriber, which performs speech-to-text transcription, and SpeechDetector, which identifies voice activity in an audio stream. In many use cases, SpeechTranscriber alone is sufficient, but the modular design allows for greater flexibility when combining different types of analysis.

The SpeechAnalyzer class coordinates this process. It manages the attached modules, receives incoming audio, and controls the overall analysis workflow. Modules can be added or removed dynamically during a session, and each module will only process audio from the point it was attached. This architecture gives developers control over performance, resource usage, and the level of detail captured during transcription.

How to Use It

We've integrated this new capability with AI SDK experimental_transcribe, making it incredibly simple to get started. With just a few lines of code, you can transcribe audio files.

The function takes an audio source (as an ArrayBuffer or a base64-encoded string) and returns the transcribed text, along with detailed segment information and the audio's total duration.

import { experimental_transcribe as transcribe } from 'ai'
import { apple } from '@react-native-ai/apple'

const file = await fetch('https://example.com/audio.wav')
const audio = await file.arrayBuffer()

const { text, segments, durationInSeconds } = await transcribe({
  model: apple.transcriptionModel(),
  audio,
})

console.log(text)
// "This is a test transcription."

console.log(segments)
// [
//   { text: 'This', startTime: 0.1, endTime: 0.3 },
//   { text: 'is', startTime: 0.3, endTime: 0.4 },
//   { text: 'a', startTime: 0.4, endTime: 0.5 },
//   { text: 'test', startTime: 0.5, endTime: 0.8 },
//   { text: 'transcription.', startTime: 0.8, endTime: 1.5 }
// ]

console.log(durationInSeconds)
// 1.5
The API is highly-optimized to support ArrayBuffers natively, thanks to JSI. This means that you can pass audio data directly without any additional encoding or decoding steps.

Multi-Language Support

You can specify a language using its ISO 639-1 code for more precise control:

await experimental_transcribe({
  model: apple.transcriptionModel(),
  audio: audioArrayBuffer,
  providerOptions: {
    apple: {
      language: 'fr' // Transcribe in French
    }
  }
})

By default, the model will use the device's primary language for transcription.

Painless Asset Management

Apple's SpeechAnalyzer requires language-specific assets to be present on the device. Our provider handles this automatically, requesting the necessary assets when a transcription is initiated.

For a more proactive approach, you can manually prepare the assets. This is useful for ensuring that the models are already available before the user needs them, resulting in an instantaneous transcription experience.

For example, to prepare the English language assets, you could do the following:

import { NativeAppleSpeech } from '@react-native-ai/apple'

await NativeAppleSpeech.prepare('en')
A key benefit of this architecture is that all language models are stored in a system-wide asset catalog, completely separate from your app bundle. This means zero impact on your app's size.

Unmatched Performance

Running on-device with Apple's optimized frameworks delivers a significant performance advantage.

System Processing Time Performance
Apple SpeechAnalyzer 45 seconds Baseline
MacWhisper Large V3 Turbo 1 minute 41 seconds 2.2× slower

According to community benchmarks, transcribing a 34-minute audio file is over 2.2 times faster than using Whisper's Large V3 model.

Conclusion

With the addition of on-device speech transcription, we are continuing our mission to provide React Native developers with a comprehensive, private, and high-performance AI toolkit.

We encourage you to explore the documentation, try out the new feature, and share your feedback with us on GitHub.

‍

Insights

Learn more about AI

Building a Software Factory: Write Specs an Agent Can Build From — cover

Nov 6Article

Building a Software Factory: Write Specs an Agent Can Build From

Learn how to research requirements, resolve open decisions, and write testable specs that AI coding agents can implement without the planning conversation.

 Large-Scale Migrations With Coding Agents: Planning, Verification, and Rollback — cover

Nov 4Article

Large-Scale Migrations With Coding Agents: Planning, Verification, and Rollback

Plan codebase migrations with coding agents using reviewable requirements, verification checks, staged rollouts, and defined rollback criteria.

Conversational Banking: From Customer Questions to Authorized Actions — cover

Nov 2Article

Conversational Banking: From Customer Questions to Authorized Actions

Explore conversational banking architecture through a card-dispute example, covering tool access, authorization, execution, observability, and human handoff.

Building a Software Factory: The Night My Agents Waited for Me — cover

Oct 28Article

Building a Software Factory: The Night My Agents Waited for Me

Learn how permissions, review limits, and missing product decisions stalled two overnight coding agent runs, and how their maintainer revised the workflow.

Your AI Coding Agent Still Needs an Architecture — cover

Oct 22Article

Your AI Coding Agent Still Needs an Architecture

Use explicit contracts, behavior tests, and dependency checks to guide AI coding agents and review their changes through a TypeScript favorites example.

cover

Oct 15Live Stream

Who Left the Agents Running? React Native Software Factories

Join Kewin Wereszczyński and Szymon Chmal to explore what can go wrong in a React Native software factory overnight and the controls that keep agents on track.

cover

Oct 14Podcast

When Coding Gets Faster, What Breaks Next?

Matt Hargett explains how AI moves bottlenecks across testing, deployment, infrastructure, support, and the rest of software delivery.

cover

Oct 12Podcast

AI Coding Agents and Hermes With Tzvetan Mikov

Tzvetan Mikov discusses AI coding agents, context switching, low-level engine optimization, reviewing specs and tests, and his plans for Hermes X.

cover

Oct 12Podcast

State Machines for AI Agents With David Khourshid

David Khourshid explains state machines for AI agents, human approval steps, tracing, and handling invalid model outputs in agent workflows.

cover

Oct 9Article

How to Maximize AI SDLC? Measure the Outer Business Loop, Not the Inner Developer Loop

Connect AI-assisted development to measurable business outcomes. Matt Hargett shares a checklist for assessing user exposure, results, and delivery costs.

cover

Oct 7Talk

Automating Mobile QA with Cloud Agents

Michał Pierzchała shows how cloud-based QA agents can test real iOS and Android user flows and bring screenshots, recordings, and logs into pull requests.

cover

Oct 1Live Stream

Can Jev Make AI Agent Decisions Faster?

Explore Jev with Kewin Wereszczyński and Szymon Chmal: how it works, its approach to faster agent decisions, and possible local alternatives.

cover

Mar 19Tutorial

The Hard Way vs. The React Native AI SDK Way: Stop Writing Custom Modules for Every Model

Learn how React Native AI uses a unified provider model to switch between cloud and on-device LLMs without rewriting application logic, enabling reliable AI experiences online and offline.

cover

Mar 12Tutorial

Build Smarter Apps: Tool Calling & AI Orchestration Explained

Learn how on-device models in React Native can call tools, interact with external APIs, and return structured outputs you can use directly in application logic.

cover

Mar 5Tutorial

MLC LLM + React Native: On-Device AI Without the Pain

Learn how to run third-party on-device LLMs in React Native using MLC LLM. Choose your models, run them efficiently across platforms, and keep a unified JavaScript API with React Native AI.

cover

Feb 24Tutorial

Intelligent Fallbacks with Apple Intelligence in React Native

Learn how to use Apple’s built-in Foundation Models in React Native apps, reduce memory usage, and enable fast, fully on-device AI with React Native AI Apple.

cover

Feb 10Tutorial

What Is the React Native AI SDK? A Complete Intro & Quickstart

Learn why on-device AI matters for React Native apps, how local LLMs behave offline, and what problems React Native AI is designed to solve from day one.

cover

Jan 29Tutorial

Implementing an Android TurboModule with Kotlin

Learn how to implement a React Native TurboModule on Android, from the TypeScript spec and Codegen to the Kotlin implementation and package registration.

cover

Jan 19Tutorial

Working with Different Threads in Swift TurboModules

Learn how JavaScript, native module, background, and main threads interact in React Native TurboModules, and how to use GCD queues to run async work safely in Swift.

cover

Jan 9Tutorial

How to Add Type-Safe Constants to Swift TurboModules

Learn how to expose typed, immutable constants from a Swift TurboModule using Codegen, and get full end-to-end type safety between native and JavaScript.

cover

Dec 30Tutorial

Adding Event Emitters to Your TurboModule in Swift

Learn how to emit native events from a Swift TurboModule and subscribe to them in JavaScript, including proper memory management and Codegen integration.

cover

Dec 22Tutorial

Writing Your First TurboModule in Swift

Learn how to build a fully working TurboModule in Swift, integrate it with Codegen, and bridge it through Objective‑C inside an Expo app.