Learn how to integrate Smallest AI TTS in Vonage for telephony solutions.
This guide demonstrates how to use the Smallest AI API with telephony call functionality. It sets up a local FastAPI server to stream audio data and uses ngrok to expose the server to the public for testing.
You can access the code for this example on GitHub here .
Before you begin, ensure you have the following:
Start by creating a .env
file in your project directory with the necessary API keys. This configuration is essential for interacting with Smallest.ai and Vonage.
Additionally, ensure that the private key is added to secrets/private.key
.
Ngrok is used to expose your local FastAPI server to the public internet. Follow these steps:
https://abcd-1234-5678.ngrok.io
).To run the example code, you’ll need to install the required dependencies. Run the following command:
Now, you can start the FastAPI server, which will handle the streaming of audio.
Run the Vonage server:
Now that the FastAPI server is up and running, it’s time to make a phonetic call. This client connects to the server, and you can test the audio stream with the desired telephony platform.
Update the phone numbers and ngrok URL in the script, then run:
If you’ve successfully run ngrok, your application will be accessible via a public URL provided by ngrok, such as https://abcd-1234-5678.ngrok.io
.
This public URL will allow external services like Vonage to interact with your server.
.env
file contains all required keys for Vonage to ensure successful API calls.If you face any issues during setup or while making calls, ensure the following:
.env
file.pip install -r requirements.txt
.If issues persist, you can reach out to the Smallest AI support team or raise an issue on the GitHub repository.
This setup provides seamless testing of phonetic calls using the Smallest AI API and Vonage for real-time voice interaction.
Learn how to integrate Smallest AI TTS in Vonage for telephony solutions.
This guide demonstrates how to use the Smallest AI API with telephony call functionality. It sets up a local FastAPI server to stream audio data and uses ngrok to expose the server to the public for testing.
You can access the code for this example on GitHub here .
Before you begin, ensure you have the following:
Start by creating a .env
file in your project directory with the necessary API keys. This configuration is essential for interacting with Smallest.ai and Vonage.
Additionally, ensure that the private key is added to secrets/private.key
.
Ngrok is used to expose your local FastAPI server to the public internet. Follow these steps:
https://abcd-1234-5678.ngrok.io
).To run the example code, you’ll need to install the required dependencies. Run the following command:
Now, you can start the FastAPI server, which will handle the streaming of audio.
Run the Vonage server:
Now that the FastAPI server is up and running, it’s time to make a phonetic call. This client connects to the server, and you can test the audio stream with the desired telephony platform.
Update the phone numbers and ngrok URL in the script, then run:
If you’ve successfully run ngrok, your application will be accessible via a public URL provided by ngrok, such as https://abcd-1234-5678.ngrok.io
.
This public URL will allow external services like Vonage to interact with your server.
.env
file contains all required keys for Vonage to ensure successful API calls.If you face any issues during setup or while making calls, ensure the following:
.env
file.pip install -r requirements.txt
.If issues persist, you can reach out to the Smallest AI support team or raise an issue on the GitHub repository.
This setup provides seamless testing of phonetic calls using the Smallest AI API and Vonage for real-time voice interaction.