Spaces:
Running

microfunnel-api / backend /scripts /test_voice.py
axeronis
feat: Unified AI Brain 2.0 (Merged Knowledge Base & Persona, Removed /knowledge routes)
20ee727
Raw History Blame Contribute Delete
819 Bytes
import asyncio
import os
import sys
# Add parent directory to path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from app.services.voice_service import voice_service
async def main():
text = "This is MicroFunnel Command Center. Systems initialized. Deployment authorized."
print(f"Generating audio for: '{text}'")
try:
audio_bytes = await voice_service.generate_audio(text, voice="onyx")
output_file = "test_voice.mp3"
with open(output_file, "wb") as f:
f.write(audio_bytes)
print(f"โœ… Success! Audio saved to {output_file}")
print(f"๐Ÿ“Š Size: {len(audio_bytes)} bytes")
except Exception as e:
print(f"โŒ Error: {e}")
if __name__ == "__main__":
asyncio.run(main())