LangVoice Python SDK: Complete Guide
Everything you need to use LangVoice in Python.
Installation
pip install langvoice-sdk
Basic Usage
from langvoice_sdk import LangVoiceClient
client = LangVoiceClient(api_key="your-api-key")
# Generate speech
response = client.generate(
text="Hello, world!",
voice="heart",
language="american_english"
)
# Save to file
response.save("hello.mp3")
Available Voices
# List all voices
voices = client.get_voices()
for voice in voices:
print(f"{voice.name}: {voice.description}")
28+ voices including: Heart, Emma, Michael, James, Sarah, Emily...
Multi-Voice Conversations
script = """
[heart] Welcome to our podcast!
[michael] Thanks for having me.
[heart] Let's dive into today's topic.
"""
response = client.generate_multi_voice(
text=script,
language="american_english"
)
Async Operations
import asyncio
from langvoice_sdk import AsyncLangVoiceClient
async def generate_audio():
client = AsyncLangVoiceClient(api_key="your-key")
response = await client.generate(
text="Hello async!",
voice="heart"
)
return response
audio = asyncio.run(generate_audio())
AI Agent Integration
from langvoice_sdk.tools.langchain_tools import LangVoiceLangChainToolkit
toolkit = LangVoiceLangChainToolkit(api_key="your-key")
tools = toolkit.get_tools()
Get started with the LangVoice Python SDK today!
Tags
Ready to Transform Your Text to Speech?
Try LangVoice free and experience the most natural AI voices for your content.
Try LangVoice Free


