A lot of AI apps are starting to mix voice, language models, and generated audio.
I built a small Python example that shows that full loop:
Repo: https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python The app exposes a Flask API for translating spoken content.
You send it an audio file and a target language. It returns:
So instead of only translating text, the example shows a practical speech-to-speech style workflow.
This kind of flow can be useful for apps that need multilingual voice experiences, like:
The important part is that each step stays understandable. Speech-to-text, translation, and text-to-speech are separate pieces, so you can debug or replace one part without rewriting the whole app.
The app uses Telnyx APIs for the voice and AI parts of the workflow.
At a high level:
That gives you a clean starting point for building your own multilingual AI workflow.
Clone the repo:
`git clone https://github.com/team-telnyx/telnyx-code-examples.git`
cd telnyx-code-examples/ai-content-translator-python
Install dependencies and set up your environment:
pip install -r requirements.txt
cp .env.example .env
python app.py
Then call the translation endpoint with an audio file and target language. Check the README for the exact request shape:
https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python It is a useful pattern for anyone building AI apps where the interface is not just text. Text-only LLM demos are helpful, but a lot of real user experiences involve audio: people speaking, systems responding, and content moving across languages.
This example keeps the workflow small enough to understand, while still showing how speech-to-text, LLM translation, and text-to-speech can fit together in one app.
The Telnyx code examples repo is also structured to be agent-readable, so coding agents can inspect the examples, understand the API patterns, and help you extend them into fuller applications.
Resources:
[Code example](https://github.com/team-telnyx/telnyx-code-examples/tree/main/ai-content-translator-python)
[Telnyx Developer Docs](https://developers.telnyx.com)