Jimmy
10/05/2025, 5:48 AMChiranjeet Mishra
10/05/2025, 5:48 AMVapi Support Bot
10/05/2025, 5:49 AMjs
function preprocessText(text) {
return text
.replace(/[^a-zA-Z0-9\s.,!?-]/g, '') // Remove special characters
.replace(/\s+/g, ' ') // Normalize whitespace
.trim();
}
Test your TTS endpoint with this cleaned text to see if the issue persists.
For more, see the [custom TTS troubleshooting guide](https://docs.vapi.ai/customization/custom-voices/custom-tts#troubleshooting).
Source:
- [Custom TTS integration](https://docs.vapi.ai/customization/custom-voices/custom-tts)Jimmy
10/05/2025, 6:02 AMJimmy
10/06/2025, 10:51 AMChiranjeet Mishra
10/08/2025, 8:58 AM