This document covers Yova's performance characteristics, including current test results and design strategies for optimizing response times and reducing processing lag.
- Test Device: Raspberry Pi 5
- Test Sentence: "What is the capital of France?"
- text2speech model: gpt-4o-mini-tts
- speech2text model: gpt-4o-transcribe
Before presenting the test results, it's important to understand what each timing measurement represents:
- Input: Duration from pressing the push-to-talk button to the start of recording
- Question: Duration from releasing the push-to-talk button to sending the message to the backend API
- Answer: Duration from receiving the first chunk of response from the backend API to the start of playing speech
Note: All durations are measured in milliseconds (ms).
| Input | Question | Answer |
|---|---|---|
| 114 | 487 | 695 |
| 55 | 501 | 582 |
| 65 | 546 | 581 |
| 66 | 521 | 459 |
| 68 | 526 | 715 |
| 71 | 603 | 740 |
| 66 | 830 | 1042 |
| 65 | 552 | 573 |
| 60 | 529 | 951 |
| 60 | 634 | 797 |
| 71 | 516 | 873 |
- Input: 66 ms
- Question: 529 ms
- Answer: 715 ms
The total lag from releasing the push-to-talk button to hearing the response is 1.244 seconds (Question + Answer medians). This measurement excludes the API response time, which is outside of Yova's boundaries.
Strategy: Leverage OpenAI's realtime API capabilities for faster response generation.
Benefits:
- Reduced API round-trip time
- Lower latency for complex queries
- Better handling of long-form responses
- Improved streaming capabilities
Strategy: Process audio input in real-time chunks rather than waiting for complete speech.
Benefits:
- Earlier detection of speech completion
- Reduced perceived latency
- Better handling of long utterances
- Improved accuracy through context accumulation
Strategy: Stream responses from the backend API instead of waiting for complete responses.
Benefits:
- Faster start of text-to-speech processing
- Reduced time-to-first-audio
- Better user experience for long responses
- Improved perceived responsiveness
Strategy: Convert text to speech in sentence-sized chunks to start audio playback earlier.
Benefits:
- Reduced time-to-first-audio
- Better handling of long responses
- Improved perceived responsiveness
- More natural speech flow
To make Yova feel even more responsive, implement immediate feedback right after the user finishes speaking:
- User finishes speaking → Yova detects speech completion
- Immediate response → Play a quick acknowledgment sound/word
- Process request → Continue with the normal API call flow
- Trigger: Listen for
yova.asr.resultevent (when speech recognition completes) - Response: Immediately publish
yova.api.tts.chunkwith a quick acknowledgment - Examples: "Hmm...", "Okay...", "Sure thing...", "Got it...", "Right..."
- Latency: ~200-400ms for acknowledgment + normal processing
- Trigger: Listen for
yova.asr.resultevent - Response: Publish
yova.api.tts.chunkwith base64-encoded audio - Format:
data:audio/wav;base64,UklGRiQA...(see events.md for details) - Examples: Pre-record "Hmm...", "Okay...", "Sure thing..." as WAV files
- Latency: ~50-100ms (no TTS processing needed)
- Trigger: Listen for
yova.asr.resultevent - Response: Publish multiple
yova.api.tts.chunkevents with lower priority scores - First segment: Pre-recorded audio (e.g., "Hmm...", "Let me think...")
- Follow-up segments: TTS-generated text (e.g., "about that...", "for a moment...", "let me check...")
- Priority: Use lower priority scores (e.g., 50) so actual responses (priority 100) skip filler
- Latency: ~50-100ms but very long coverage
- Perceived responsiveness: User gets instant feedback that Yova heard them
- Better UX: Eliminates the "did it hear me?" uncertainty
- Natural conversation flow: Mimics human conversation patterns
- Lower latency: Pre-recorded audio eliminates TTS processing time
Strategy: Structure responses to start with short, simple sentences.
Why It Works:
- Short sentences are processed faster by TTS engines
- Simple sentence structures require less linguistic analysis
- Early audio playback improves perceived responsiveness
- Complex sentences can follow after the initial response
Examples:
- ✅ Good: "Sure! The capital of France is Paris. It's a beautiful city known for..."
- ❌ Avoid: "Well, let me think about that for a moment. The capital of France, which is located in Western Europe and has a rich history dating back to..."
Implementation:
- Instruct AI models to start responses with concise statements
- Use response templates that prioritize brevity early
- Implement response restructuring if needed
- Monitor TTS processing times for different sentence lengths