Latency Optimization for Falcon 2
Latency is the time it takes for Falcon 2 to begin returning audio after receiving a text-to-speech request. For voice agents and real-time applications, lower latency creates faster and more natural conversations.
How Streaming Improves Latency
Falcon 2 supports streaming output, which allows audio to be delivered in small chunks as it is generated.
Instead of waiting for the entire audio file to be created, playback can begin immediately when the first audio chunk is received. This reduces perceived response time and improves the user experience in real-time applications.
Measure Latency Correctly
When using Streaming or WebSocket endpoints, the most important metric to track is Time to First Audio Byte (TTFB).
TTFB measures how quickly Falcon 2 starts sending audio after receiving a request and is the best indicator of real-time performance.
Understanding Latency Metrics
- DNS Lookup Time – Time spent resolving the server address.
- Connection Time – Time required to establish a network connection.
- TLS Handshake Time – Time spent creating a secure connection.
- Time to First Audio Byte (TTFB) – Time until the first audio data is received.
- Total Response Time – Time required to receive the complete response.
For real-time applications, focus on Time to First Audio Byte (TTFB) rather than total response time.
Measure Latency
You can measure latency using tools such as:
- curl to inspect detailed timing metrics.
- Postman to view request duration and response times.
For the most accurate results, test from the same environment where your application or voice agent will be deployed.
Best Practices for Achieving Low Latency
1. Choose the Right Region
Choose the Murf region closest to your application or use the Global Endpoint, which automatically routes requests to the nearest available region.
2. Test from Your Production Environment
Latency can vary depending on where requests are sent from. For the most accurate results, test from the same environment where your application or voice agent will run
3. Optimize Text Input
Language, script, and text length can affect response times. Shorter text is processed faster and can improve response times.
For supported languages, use native scripts instead of transliterated text.
For example:
✅ Hindi: आप कैसे हैं?
❌ Hindi: aap kaise hain?
4. Use Connection Pooling
Connection pooling allows your application to reuse existing network connections instead of creating a new one for every request.
By keeping connections open and reusing them when possible, you can reduce connection overhead, improve response times, and achieve lower first-byte latency in real-time applications.