Clients often face issues with noisy recordings and poor quality voice clones. We solve this by selecting the right provider and optimizing the recording process. On a recent audiobook project, we cut voiceover costs by 40% while maintaining naturalness by fine-tuning the recording environment and using ElevenLabs' professional voice cloning. Below we break down the technical implementation using the ElevenLabs API — the de facto standard for voice cloning. Our team has over 5 years of mobile development experience and has completed 30+ AI integration projects. To discuss your specific case, reach out to our engineers.
Provider Comparison for Voice Cloning
| Provider |
Minimum Audio |
Quality |
RU Support |
Streaming |
| ElevenLabs |
1 min (Instant) / 30 min (Professional) |
High |
Yes |
Yes |
| Resemble AI |
5 min |
Medium |
Limited |
Yes |
| PlayHT |
5–10 sec |
Lower |
Yes |
No |
ElevenLabs is the de facto standard. For Russian, 2–5 minutes of clean speech in 16-bit WAV works well. Subscription costs $5–$22/month depending on plan. Savings on voice actors can reach 40% with regular synthesis. For example, a typical monthly voiceover bill of $1,200 could be reduced to $720.
How to Ensure High-Quality Recordings?
Clone quality directly depends on recording. Our recommendations:
| Parameter |
Recommendation |
| Sample rate |
44100 Hz or 48000 Hz |
| Format |
WAV (PCM 16-bit) or FLAC |
| Minimum duration |
60 seconds (preferably 3–5 minutes) |
| SNR |
> 20 dB |
On iOS, record using AVAudioEngine with format pcmFormatFloat32, then convert to WAV:
func exportToWAV(pcmBuffer: AVAudioPCMBuffer, destinationURL: URL) throws {
let settings: [String: Any] = [
AVFormatIDKey: kAudioFormatLinearPCM,
AVSampleRateKey: 44100.0,
AVNumberOfChannelsKey: 1,
AVLinearPCMBitDepthKey: 16,
AVLinearPCMIsFloatKey: false,
AVLinearPCMIsBigEndianKey: false
]
let file = try AVAudioFile(forWriting: destinationURL, settings: settings)
try file.write(from: pcmBuffer)
}
On Android, use AudioRecord with ENCODING_PCM_16BIT, 44100 Hz, and write WAV with a 44-byte header.
Uploading Voice to ElevenLabs
After recording, upload audio via multipart request:
func uploadVoice(audioURLs: [URL], name: String) async throws -> String {
var request = URLRequest(url: URL(string: "https://api.elevenlabs.io/v1/voices/add")!)
request.httpMethod = "POST"
request.setValue(apiKey, forHTTPHeaderField: "xi-api-key")
let boundary = UUID().uuidString
request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
var body = Data()
body.append("--\(boundary)\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\(name)\r\n".data(using: .utf8)!)
for (i, url) in audioURLs.enumerated() {
let audioData = try Data(contentsOf: url)
body.append("--\(boundary)\r\nContent-Disposition: form-data; name=\"files\"; filename=\"sample_\(i).wav\"\r\nContent-Type: audio/wav\r\n\r\n".data(using: .utf8)!)
body.append(audioData)
body.append("\r\n".data(using: .utf8)!)
}
body.append("--\(boundary)--\r\n".data(using: .utf8)!)
request.httpBody = body
let (data, _) = try await URLSession.shared.data(for: request)
let response = try JSONDecoder().decode(VoiceResponse.self, from: data)
return response.voice_id
}
Store the voice_id securely (iOS Keychain, Android SharedPreferences) — it's needed for all TTS requests.
Managing Voice Profiles
The app should allow:
- Creating multiple voice profiles (own voice, character, narrator).
- Renaming and deleting via
DELETE /v1/voices/{voice_id}.
- Quality checking: play a test phrase immediately after creation.
Locally store voice_id and metadata. After successful upload, audio samples can be removed since they reside with the provider. If you need customized profile management, commission a module from us.
Importance of User Consent
ElevenLabs requires confirmation that the user is cloning their own voice or has permission. We implement a consent checkbox and store a timestamp. App Store Review Guidelines 5.1.4 require explicit consent for biometric data collection. Additionally, under GDPR, voice cloning may be considered biometric data processing — notification and consent are necessary. Consult a lawyer, but informed consent usually suffices.
Step-by-Step Integration Guide
Expand for details
- Recording preparation: Configure
AVAudioSession at 44100 Hz on iOS, AudioRecord with 16-bit PCM on Android. Ensure SNR > 20 dB.
- Sample upload: Send WAV file via multipart request to ElevenLabs. Save the returned
voice_id.
- Speech synthesis: Use
voice_id in TTS request POST /v1/text-to-speech/{voice_id}. Pass text and stability/clarity settings.
- Playback: Play the resulting MP3 stream via
AVAudioPlayer or ExoPlayer.
- Caching: Save generated audio files locally for reuse.
What We Deliver
We provide a turnkey project including:
- Recording screen with waveform, volume meter, noise reduction.
- Integration with ElevenLabs (or another provider) via REST/GraphQL.
- Voice profile management with local cache.
- Speech synthesis using cloned voice via TTS API.
- Documentation for push notification setup (APNs/FCM) for background audio download.
- Clone quality testing on real devices.
- Codebase with comments and architecture overview.
- Deployment support and 1 month of post-launch maintenance.
Our team has over five years of mobile development experience and dozens of AI integration projects. We guarantee stable operation following App Store and Google Play guidelines. To get a consultation and individual timeline/budget estimate, contact us.
Common Mistakes
- Recording via
AVAudioSession without explicitly setting preferredSampleRate: 44100 — the system may choose 16000 Hz, degrading the clone.
- Sending uncompressed WAV (~30 MB) over mobile data — use background upload via
URLSession.background.
- Ignoring consent snippets — the app may be rejected during moderation.
Implementation Timeline
Basic integration (recording + upload + TTS): 5–8 days. Full flow with profiles, Recorder UI, and testing: 2–3 weeks. We'll assess your project for free — just write to us.
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
-
Task analysis — measure latency, privacy, size, supported devices.
-
Model prototyping — in Python, evaluate accuracy on target data.
-
Conversion and quantization — for CoreML/TFLite with validation.
-
Integration into the app — model wrapped in a service layer (easy to swap CoreML ↔ TFLite ↔ cloud).
-
Testing — on real devices, measure FPS, RAM, battery.
-
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.