import pyttsx4
# Maelezo ya sauti
narration_text_en = """
I am a descendant of the Kwahhayi clan — a proud branch of the Wairaqi people of Tanzania.
The name Kwahhayi means "to throw" — a symbol of release, strength, and continuity of generations.
My clan name is Tlhathlaa, meaning "Daylight" — the light of life and the rise of new beginnings.
The Wairaqi are a Cushitic community that migrated from the Horn of Africa thousands of years ago.
Today, we proudly preserve our language, Iraqw, our deep-rooted traditions, and the honor of our lineage.
From my bloodline to the world, my voice says: I am Wairaqi. I am Kwahhayi. I am Tlhathlaa.
"""
# Anzisha injini ya sauti
engine = pyttsx4.init()
# Chagua sauti ya kiume au kike
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id) # 0 kwa sauti ya kiume, 1 kwa sauti ya kike
# Seti kasi ya sauti
engine.setProperty('rate', 150)
# Seti sauti
engine.setProperty('volume', 1)
# Hifadhi sauti kwenye faili
audio_file_path_en = "Wairaqi_Clan_Username_English.mp3"
engine.save_to_file(narration_text_en, audio_file_path_en)
engine.runAndWait()
print(f"Sauti imehifadhiwa kwenye: {audio_file_path_en}")