Skip to main content

Installation

Install the vocode package:

Getting started

The io extra installs the packages necessary to run our voice conversations locally, but is not needed for other surfaces, e.g. phone calls. You may need to install portaudio and ffmpeg on your system.

Working with system audio

We provide helper methods to hook into your system audio.
If the default I/O devices are not being set properly, set use_default_devices to False to select them before kicking off the conversation.

Self-hosted

Environments

Vocode provides a unified interface across various speech transcription, speech synthesis, and AI/NLU providers. To use these providers with Vocode, you’ll need to grab credentials from these providers and set them in the Vocode environment.
For AZURE_SPEECH_REGION you should use the URL format. For example, if you’re using the “East US” region, the value should be “eastus”. See Azure Region list. We also offer a hosted solution where you don’t need to worry about getting these credentials — see below.

StreamingConversation example

A note on echo cancellation

As of now, there is no default echo cancellation enabled for system audio conversation, so this works best with headphones, otherwise the bot audio feeds back into the input audio stream. On some speakers (eg phone calls) this is handled by the device itself. Another fix for this is to pipe your microphone / speaker to Krisp.AI. Download their application and select the Krisp virtual audio devices when running the script! Stay tuned for updates here, tracking in this GitHub issue.