VICIfast
Operations

How to mix TTS with recorded audio in one prompt

Drop audio tags into a VICIdial TTS entry to play recorded WAV files alongside spoken lead data inside the same prompt.

VICIfast Support
··2 min read
How to mix TTS with recorded audio in one prompt

You do not have to choose between a polished recorded voice and the flexibility of text-to-speech. VICIdial lets you weave both into a single prompt: a professionally recorded line, then a spoken name pulled from the lead, then another recording. The trick is one small tag inside the TTS Text field.

The audio tag

Inside a TTS (text to speech) entry you can play a recorded file by dropping in an audio tag that points at the file path:

<audio src='/var/lib/asterisk/sounds/please-press-one.wav' />

Everything outside the tag is spoken by the engine. Everything inside the tag plays your recorded file. You can chain as many as you want, in any order, mixed with text.

A real example

Here is a confirmation prompt that uses four recorded files and speaks the contact's name from the Lead table between them. The pattern reads: "If this is FIRSTNAME LASTNAME please press one. If this is not FIRSTNAME LASTNAME please hang up now."

<audio src='/var/lib/asterisk/sounds/if-this-is.wav' /> --A--first_name--B-- --A--last_name--B-- <audio src='/var/lib/asterisk/sounds/please-press-one.wav' /> <audio src='/var/lib/asterisk/sounds/if-this-is-not.wav' /> --A--first_name--B-- --A--last_name--B-- <audio src='/var/lib/asterisk/sounds/please-hang-up-now.wav' />

The recorded chunks carry your brand voice. The --A--first_name--B-- and --A--last_name--B-- tokens are spoken by TTS from each lead's data, so every call is personalized without recording a name for every contact.

Where the files live

The audio store places uploaded files in /var/lib/asterisk/sounds, which is why the example paths point there. If you keep files in another directory, adjust the path in the tag to match. Keep these points in mind:

  • The path inside the tag must be the exact location of the file
  • Files uploaded through the audio store land in /var/lib/asterisk/sounds by default
  • The spoken text between tags can use any VICIdial Script variable available in the Script section

How a mixed prompt renders

At play time the engine walks the entry left to right. Recorded tags pull the matching file from the Asterisk sounds directory, while the text between them is rendered to speech, and the Dialplan stitches it all into one continuous prompt for the caller.

flowchart TD
  A["TTS entry text"] --> B{"Audio tag or text?"}
  B -->|Audio tag| C["Load WAV from sounds dir"]
  B -->|Plain text| D["Render with TTS engine"]
  C --> E["Concatenate segments"]
  D --> E
  E --> F["Play one prompt to caller"]
Recorded files must already exist at the path you reference. A bad path means silence at that point in the prompt, so confirm every file is uploaded before you go live.

Putting it to work

This pattern is ideal for a Campaign confirmation message or a survey intro where most of the wording is fixed but a name or detail changes per contact. Before you build one, make sure your recorded files are in place. The audio store overview covers how uploads land in the sounds directory, and the audio prompts and TTS guide ties the whole prompt system together.

Once your entry is built, you point a campaign prompt at it. The next step is covered in how to use a TTS entry in a campaign audio field. If you would rather not manage Recording format (WAV/MP3) details and file paths yourself, check our managed plans.

About VICIfast LLC

VICIfast LLC operates a managed VICIdial hosting + BYOI service for outbound and inbound call centers. We run the dialers, the carriers, the recordings pipeline, and the compliance plumbing so operators don’t have to.

Citing this article

VICIfast Engineering. “How to mix TTS with recorded audio in one prompt”. VICIfast LLC, June 27, 2026. Retrieved from https://vicifast.com/blog/how-to-mix-tts-and-recorded-audio-vicidial

Have questions?

Related posts

You might be interested in

VICIfast newsletter

Liked this? Get the next one in your inbox.

We ship the kind of stuff you just read — concrete, numbers-first, no drip. One email when a new post goes live. Unsubscribe in one click.

Comments

Comments are reviewed before they appear. We never publish your email.

No comments yet — be the first.