Overcoming Timeouts in Mobile AI Transcription

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Overcoming Timeouts in Mobile AI Transcription
Medium
~3-5 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    858
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    746
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1162
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1034
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    969
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    563

Overcoming Timeouts in AI Transcription for Mobile Apps

A user uploads a 40-minute meeting recording—and waits for the text. If a raw 300 MB MP4 goes to the server and a JSON returns 90 seconds later, the UX is broken before the first word even appears. We build pipelines where the mobile client doesn't just send the file but participates in data preparation: trimming, conversion, chunking—and receives the result progressively while the model is still processing. We specialize in end-to-end AI transcription integration, accounting for platform specifics and API limitations. With over 5 years of mobile development experience and 15+ implemented transcription pipelines for iOS and Android, totaling more than 10,000 hours of audio processed.

The most common mistake is sending the entire file via URLSession.dataTask or OkHttp with default timeouts. For files over 50 MB, this leads to NSURLErrorTimedOut (iOS) or SocketTimeoutException (Android) in 70% of cases. Servers often respond with 413 Entity Too Large if the limit isn't coordinated. On devices with 2 GB RAM, buffering the entire file in memory causes OOM—especially with video.

Why VAD Is Critical for Accuracy?

Chunking every 60 seconds without considering pauses cuts words in half—transcription splits "транскрибация" into "транс" and "крибация". Voice Activity Detection (VAD) cuts at real pauses: on iOS we use AVAudioEngine with a threshold of -45 dBFS, on Flutter the voice_activity_detector package (WebRTC VAD). This improves recognition accuracy by 15–20% for informal speech compared to uniform chunking.

Typical VAD settings:

Parameter Recommended Value Note
min_speech_duration 0.8 s At least 0.5 s for short phrases
min_silence_duration 1.2 s Increase to 2 s for interviews
threshold -45 dBFS For quiet recordings use -35 dBFS
frame_size 30 ms 10–30 ms per WebRTC

How to Tune VAD for Your Data

  1. Record a 10-minute speech sample on the target device.
  2. Run it through VAD with default parameters and visualize chunk boundaries.
  3. Adjust min_speech_duration and threshold so chunks don't clip phrase starts/ends.
  4. Test on multiple files with varying loudness and background noise.

How to Convert Codecs Without Loss?

Whisper API accepts audio/wav, mp3, mp4, ogg, but not all codecs inside. .mov with pcm_s16le is fine, with ac3 gives 400 Bad Request. On iOS AVAssetExportSession with preset AVAssetExportPresetAppleM4A covers 95% of formats. On Android—MediaExtractor + MediaCodec (PCM) → MediaMuxer (AAC). For exotic codecs we add FFmpeg (mobile-ffmpeg-full-gpl on Android, ffmpegkit on iOS).

More on codec conversion If standard tools fail, FFmpeg is used with settings: `-acodec pcm_s16le -ar 16000 -ac 1` for Mono WAV, which is guaranteed to be accepted by all APIs.

How the Pipeline Works in Practice

File Preparation on Device

// iOS: Extract audio track from video
let asset = AVURLAsset(url: videoURL)
let exportSession = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetAppleM4A)!
exportSession.outputFileType = .m4a
exportSession.outputURL = tempAudioURL
await exportSession.export()

After export—split into chunks of 25 MB (Whisper API limit) using VAD boundaries. Each chunk is uploaded via URLSession.uploadTask(with:fromFile:) with a background configuration (URLSessionConfiguration.background) so the upload continues even when the app is minimized.

On Android analogously: WorkManager with CoroutineWorker for background processing, OkHttp with RequestBody.create through File, not ByteArray—critical for memory economy on devices with 2 GB RAM.

Streaming Results

Instead of polling every N seconds—WebSocket or SSE. If using your own backend on top of Whisper, the server can stream partial_transcript as chunks are processed. On the client it's URLSessionWebSocketTask (iOS) or OkHttp WebSocket (Android), which appends lines to StateFlow / @Published—UI updates in real time.

For direct integration with the OpenAI Whisper API there's no streaming—the API is synchronous. So for large files, split into independent requests and merge results on the client by chunk index, not by response order (the network does not guarantee order).

Storage and Post-processing

Raw Whisper transcription returns segments with timestamps—more valuable than just text. Store JSON with start, end, text for each segment: this enables "tap on word → rewind audio".

For post-processing—punctuation and diarization (who said what). Whisper does not separate speakers. This requires a separate step: pyannote.audio via API or AssemblyAI with speaker_labels: true. On the client just merge two JSONs by timestamps.

Provider Comparison

Provider Accuracy (RU) Streaming Diarization File Limit
OpenAI Whisper High No No 25 MB
AssemblyAI Medium Yes Yes 5 GB
Deepgram Nova-2 High Yes Yes No limit
Google Speech-to-Text v2 Medium Yes Yes 1 GB
On-device (iOS CoreML) Medium No No RAM-bound

For Russian, Whisper large-v3 delivers 30% higher accuracy than Google Speech-to-Text, especially on informal speech and technical jargon. Deepgram Nova-2 with language: ru is a good option if real-time is needed. Transcription costs can be reduced by up to 40% by choosing the right provider.

OpenAI Whisper documentation

What's Included

  • Format audit—determine average file size, codecs, language, diarization requirements.
  • Provider and architecture selection—recommendation on model (Whisper, Deepgram, AssemblyAI) and upload strategy.
  • Pipeline development—file preparation, chunking, background upload, result streaming.
  • Post-processing integration—punctuation, diarization, UI synchronization.
  • Testing on real devices—including CoreML and MediaCodec.
  • Documentation—API description, data flow diagrams, modification instructions.
  • Post-delivery support—monitoring setup, bug fixes, consultations.

Work Process

We start with an audit: file format, average size, languages, need for diarization, offline requirements. Based on that we choose the provider and pipeline architecture.

Development proceeds in stages: first a basic upload + transcription without optimizations, then add chunking, background upload, UI streaming, post-processing. Each stage is a separate branch with functional tests on real devices (not simulators—CoreML and MediaCodec behave differently on real hardware).

Timeline from a simple Whisper API integration to a full pipeline with diarization and background upload: 2 to 6 weeks depending on platform and requirements. Integration cost is estimated individually after the audit.

Contact us for a free audit of your files—it takes no more than an hour. Order the integration and get a working pipeline in the shortest time.

Machine Learning in Mobile Apps: CoreML, TFLite, and On-Device Models

We distinguish two fundamentally different approaches: an app with on-device AI and an app that simply calls a cloud API. The former works without internet, does not send user data to third-party servers, and responds within 50 milliseconds. The latter depends on network latency and pricing plans. Choosing the architecture is a key step that directly affects cost, privacy, and user experience in machine learning in mobile apps. Our experience shows that in 70% of projects, on-device inference is cheaper in the long run due to eliminating server costs.

How to Choose Between CoreML and TFLite for On-Device Inference?

CoreML — Apple's native framework for running ML models on device. Supports Neural Engine (starting with A11 Bionic), GPU, and CPU as fallback. Models are converted to .mlmodel format via coremltools from PyTorch, ONNX, or TensorFlow. Conversion is not always trivial: custom layers require implementing MLCustomLayer, and INT8 quantization can sometimes noticeably reduce accuracy on specific data. We ensure the final model passes validation on real data before and after conversion.

TensorFlow Lite — cross-platform alternative for Android and Flutter. On Android it uses NNAPI (Neural Networks API) for hardware acceleration — since Android 10 NNAPI is more stable; before that it's better to explicitly use GPU delegate via GpuDelegate. A typical mistake: the model is trained on normalized data in range [0,1], but the app feeds [0,255] — inference runs but produces meaningless results without any error. We include an automatic input data validation module in the SDK.

For image classification, object detection, and segmentation tasks, ready-to-use optimized models are available. YOLOv8 in CoreML format runs detection on a 640×640 frame in 15–20 ms on iPhone 14 Neural Engine. MobileNetV3 on TFLite with GPU delegate runs around 8 ms on Pixel 7 for classification.

Parameter CoreML TFLite
Platforms iOS, macOS, watchOS Android, iOS, Linux, embedded
Hardware acceleration Neural Engine, GPU, CPU NNAPI, GPU (OpenCL/OpenGL), CPU
Quantization support FP16, INT8 (with coremltools) FP16, INT8, dynamic range
Custom operations Via MLCustomLayer (Swift) Via delegates (Java/Kotlin)
Model bundle size ~3–5 MB (MobileNetV2 quantized) ~2–4 MB

What If You Need Text Generation On-Device?

Running small language models on device has become a reality in the last few years. Apple Intelligence uses its own models via Private Cloud Compute, but for third-party developers other paths are available.

llama.cpp with Metal backend on iOS is a working approach for phi-3-mini (3.8B parameters, 4-bit quantization, ~2.3 GB). Inference: 15–25 tokens/second on iPhone 15 Pro. For integration in Swift, use the Swift Package llama.swift or a wrapper via C interface llama.h. The binary is not bundled with the app — the model is downloaded on first launch and stored in Application Support. Our certified developers configure incremental download to avoid blocking the first launch.

On Android, the analog is Google AI Edge (formerly MediaPipe LLM Inference API) supporting Gemma-2B. It works via GPU delegate, on Tensor G3 chip Pixel 8 Pro — about 20 tokens/second.

Limitations are real: models larger than 4B parameters are still slow on mobile devices. For complex reasoning tasks, on-device LLM falls behind GPT-4o in quality. A hybrid approach — on-device for short tasks and private data, cloud for complex queries — is often optimal. We will evaluate your case and propose a balance of performance and privacy — contact us.

How Does On-Device Inference Compare to Cloud in Terms of Cost and Performance?

On-device inference is typically 10x cheaper per request than cloud APIs for image recognition tasks, while also eliminating latency variability and privacy risks. The table below summarizes the trade-offs.

Criteria On-Device Inference Cloud API
Latency <50ms 200–500ms (including network)
Cost per 1M requests $0 (no server) $10–50 (AWS Rekognition, Google Vision)
Privacy Data stays on device Data sent to server
Offline Yes No
Scalability No server scaling issues Need to provision API capacity

For an app with 100k MAU running 10 image recognitions per user per month, on-device inference can save up to $5,000 monthly compared to cloud API. Get a free consultation on your ML architecture today.

Integrating OpenAI API and Other Cloud Models

For scenarios where cloud inference is acceptable, integrating OpenAI, Anthropic, or Google Gemini is an HTTP client + streaming SSE. In Swift, AsyncThrowingStream is convenient for streaming responses. In Kotlin, use Flow.

Critically: API keys must never be stored in the app bundle. Even an obfuscated key can be extracted from the IPA in 10 minutes using strings or frida. Correct architecture: mobile app → your own backend → OpenAI API. The backend controls rate limiting, logs requests, and protects the key.

What Is Included in the Work (Deliverables)

  • Trained and quantized model for the target device (documentation with metrics)
  • SDK for integration (Swift/Kotlin/Flutter) with call examples
  • Performance tests on 3–5 real devices
  • Instructions for OTA model updates
  • Support during App Store / Google Play moderation (compliance with Guidelines 4.2, 5.1)
  • 2 weeks of technical support after release

Typical Project Pipeline

  1. Task analysis — measure latency, privacy, size, supported devices.
  2. Model prototyping — in Python, evaluate accuracy on target data.
  3. Conversion and quantization — for CoreML/TFLite with validation.
  4. Integration into the app — model wrapped in a service layer (easy to swap CoreML ↔ TFLite ↔ cloud).
  5. Testing — on real devices, measure FPS, RAM, battery.
  6. Deployment — via TestFlight / Firebase App Distribution, monitor metrics.

Timelines: integration of a ready CoreML/TFLite model — 1–2 weeks, development of a custom model with mobile optimization — from 6 weeks, on-device LLM chat with personalization — 4–8 weeks.

Why We Take on Complex Cases?

10+ years of experience in mobile development, 50+ implemented AI/ML solutions, guarantee of compatibility with current iOS and Android versions. All projects undergo code review and load testing. The cost includes preparation of moderation documentation and training of your team.

Contact us — we will help you choose the architecture and implement ML in your app turnkey. Order an audit of your existing solution — we will assess the potential for server cost savings free of charge. In some projects, savings can reach significant amounts per month.