This tutorial will guide you through integrating Faseeh’s Arabic text-to-speech into your LiveKit voice agents, enabling natural-sounding Arabic conversations in your real-time applications.
# Full model - Best quality, slightly higher latencyfaseeh_tts = faseeh.TTS( model="faseeh-v1-preview", stability=0.75, speed=1.0)# Mini model - Faster, lower latency, good qualityfaseeh_tts = faseeh.TTS( model="faseeh-mini-v1-preview", stability=0.75, speed=1.0)
# Start with one voicefaseeh_tts = faseeh.TTS(voice_id="ar-uae-male-1", speed=1.0)# Switch to a different voice based on contextfaseeh_tts.update_options( voice_id="ar-hijazi-female-2", stability=0.8, speed=1.0)
Create agents that can switch between Arabic and English:
class BilingualAssistant(Agent): def __init__(self) -> None: super().__init__( instructions="""You are a bilingual AI assistant fluent in both Arabic and English. Automatically detect the user's language and respond in the same language. If the user speaks Arabic, respond in Arabic using natural expressions. If the user speaks English, respond in English.""" )@server.rtc_session()async def bilingual_agent(ctx: agents.JobContext): session = AgentSession( stt=deepgram.STT( language="multi", # Multi-language support model="nova-2-general" ), llm=openai.LLM(model="gpt-4o-mini"), tts=faseeh.TTS( voice_id="ar-uae-male-1", model="faseeh-v1-preview", speed=1.0 ), vad=silero.VAD.load(), ) await session.start(room=ctx.room, agent=BilingualAssistant())
Faseeh supports streaming for real-time applications:
# Streaming is automatically enabled# The agent will start speaking as soon as the first audio chunk is readyfaseeh_tts = faseeh.TTS( model="faseeh-mini-v1-preview", # Mini model for even lower latency stability=0.6, speed=1.0)