Custom Voice Not Triggering Voice Generation Reque...
# support
k
## Title: Custom Voice Not Triggering Voice Generation Request for First Message Issue Summary: When using a custom voice configuration, the agent fails to send a voice generation request for the first message, even when
firstMessageMode
is explicitly configured. Expected Behavior: The agent should generate and speak the first message using the configured custom voice according to the settings in
firstMessageMode
. Actual Behavior: No voice generation request is sent for the first message when a custom voice is set, resulting in a silent start to the conversation. Configuration Attempted: - Set
firstMessageMode
to
'assistant-speaks-first'
- Set
firstMessageMode
to
'assistant-speaks-first-with-model-generated-message'
- Custom voice configured as per documentation Documentation References: - Custom TTS setup: https://docs.vapi.ai/customization/custom-voices/custom-tts - First message configuration: https://docs.vapi.ai/api-reference/calls/create#request.body.assistant.firstMessage Test Call ID:
57ce58fb-11f2-4574-a2a2-aed65706db97
started at Jun 29 2025 10:48 UTC Additional Context: The issue appears to be specific to custom voice configurations, as the behavior may work correctly with default voices. The logs from the test call above should show the missing voice generation request for the first message.
@User @User Update: Working scenarios: - Direct MP3 file URLs for
firstMessage
(e.g.,
https://samplelib.com/lib/preview/mp3/sample-3s.mp3
) play successfully - Built-in OpenAI voices work correctly:
Copy code
json
"voice": {
    "provider": "openai",
    "voiceId": "nova", 
    "model": "gpt-4o-mini-tts"
}
Issue: Custom TTS models aren't playing the
firstMessage
content at all. Observation from call logs:
Copy code
[LOG] Voice input: [first message text]
Missing expected log:
Copy code
[CHECKPOINT] Assistant speech started
Actual problem: The TTS engine isn't being called for the first message (which isn't true for subsequent messages) when using custom voice configurations. Vapi appears to be skipping the first message entirely with custom TTS, rather than experiencing any latency or timeout issues.
v
Hi Kfir Ochana, To address the issue where the custom voice configuration is not triggering a voice generation request for the first message, ensure the following steps are correctly implemented: 1. **Voice Configuration**: Confirm that your custom voice is correctly set in the assistant configuration. Use the following structure:
Copy code
json
   {
     "voice": {
       "provider": "custom-voice",
       "server": {
         "url": "https://your-tts-api.com/synthesize",
         "secret": "your-secret-token-here",
         "timeoutSeconds": 30
       }
     }
   }
2. **First Message Configuration**: Verify that
firstMessage
and
firstMessageMode
are correctly set in the assistant's configuration:
Copy code
json
   {
     "firstMessage": "Welcome to our service.",
     "firstMessageMode": "assistant-speaks-first"
   }
1. **TTS Integration**: Make sure your TTS endpoint is configured to handle requests from VAPI and returns audio in the required PCM format. Here’s a snippet for the TTS server setup:
Copy code
javascript
   app.post('/api/synthesize', (req, res) => {
     // Handle synthesizing request
     res.setHeader('Content-Type', 'application/octet-stream');
     res.send(audioData);
   });
2. **Fallback Plan**: Consider adding a fallback voice to handle cases where the custom TTS might fail:
Copy code
json
   {
     "fallbackPlan": {
       "voices": [
         {
           "provider": "eleven-labs",
           "voiceId": "21m00Tcm4TlvDq8ikWAM"
         }
       ]
     }
   }
3. **Network Connectivity**: Ensure there’s no network issue between VAPI and your TTS server which might block the requests. By following these steps, the assistant should correctly generate and speak the first message using the configured custom voice. For more details, you can refer to the [Custom TTS integration guide](https://docs.vapi.ai/customization/custom-voices/custom-tts) and [Custom voices documentation](https://docs.vapi.ai/customization/custom-voices/custom-voice).
k
I appreciate you taking the time to help with this issue. However, I believe my situation goes beyond basic configuration problems. I've already implemented the voice and first message configurations correctly (as shown in my code snippet), and I've systematically tested several potential solutions. To clarify my current status: * The custom voice configuration is working perfectly** for all messages except the first one** * The first message configuration works correctly with built-in voices * I've already** tested the specific solutions you mentioned** (cachingEnabled=False, backoffPlan, and fallbackPlan) without success @User @User Since this appears to be a more complex integration issue rather than a configuration problem, could you please review the detailed observations I provided in earlier messages? I'm specifically looking for insights into __why the custom TTS server receives requests for all messages except the first one__, despite the configuration being identical. Any guidance on advanced troubleshooting steps or potential API-level issues would be greatly appreciated.
My code snippet:
Copy code
"voice": {
    "provider": "custom-voice",
    "server": {
        "url": TTS_SERVER_URL,
        "timeoutSeconds": 30,
        "secret": TTS_API_KEY,
        "backoffPlan": {
            "maxRetries": 3,
            "baseDelaySeconds": 2
        }
    },
    "cachingEnabled": False,
    "fallbackPlan": {
        "voices": [
            {
                "provider": "openai",
                "voiceId": "nova",
                "model": "gpt-4o-mini-tts"
            }
        ]
    }
},
# Set the first message
"firstMessage": "איזה כיף שענית לי!",
"firstMessageMode": "assistant-speaks-first"
@User Help, please!
v
Hey, Thanks for the details. Our team will look into it and let you know soon.
k
Thanks man! 🙌 @User Have you got any update?
v
Can you please get a latest call_id, for me to take a look into it.
k
20b31077-608f-4cd0-806d-7f39d235a1fd
@Shubham Bajaj
v
Hey Kfir, thanks for the details. Let me check with our team and get back to you soon.
k
Hi! any update?
s
@Kfir Ochana I apologize for delayed, it slipped my list. I'm digging into it now.
🟡 15:09:03:930 Couldn't Complete Say Request { "task": { "content": "Thanks for picking up the phone! Thanks for picking up the phone! Thanks for picking up the phone! Thanks for picking up the phone!", "endCallOnError": true, "interruptible": true }, "error": {} } 🟡 15:09:03:928 Couldn't Get Speech For
custom-voice:https://vu2xxxxxer.com/:16000:d763e003e95b009cad12e55e535fec922f15a56bd5b1da747a3cc8c5f4213b71
, "Thanks for picking up the phone! Thanks for picking up the phone! Thanks for picking up the phone! Thanks for picking up the phone!"
@Kfir Ochana Let me look into your other call as well.
k
I'm available to try if you want me to replicate the scenario / try different things
s
Can you confirm if this message is correct?
k
What do you mean by correct? My TTS server doesn't receive any request for generating firstMessage
s
Was this expected message?
k
Yup : "Thanks for picking up the phone! Thanks for picking up the phone! Thanks for picking up the phone! Thanks for picking up the phone!"
It's phrased weird so I won't miss it (:
s
Thanks for confirming. Let me look into the logs again.
k
@Shubham Bajaj Any insights?
s
@Kfir Ochana Update: I couldn't find anything wrong, so I'm asking the team to take another look. A different point of view might help. What could happen going wrong here?
@Kfir Ochana It's nothing to worry about. Sometimes, we can't immediately identify what might go wrong. So, it's better to seek another opinion rather than stubbornly sticking to one idea.
k
It gave me vibes of a tricky bug indeed
Appreciate how you keep trying 🙌
v
The request is taking a little longer than usual and we will continue to work on it. Thank you for your patience
k
@User any update?
v
Hey Kfir Ochana, Apologies for the delay. I have already raised your issue with the team, waiting for an update from their side. Once I received it, I'll let you know.