MCPcopy
hub / github.com/KoljaB/RealtimeTTS / set_voice

Function set_voice

example_fast_api/server.py:452–465  ·  view source on GitHub ↗
(request: Request, voice_name: str = Query(...))

Source from the content-addressed store, hash-verified

450
451@app.get("/setvoice")
452def set_voice(request: Request, voice_name: str = Query(...)):
453 print(f"Getting request: {voice_name}")
454 if not current_engine:
455 print("No engine is currently selected")
456 return {"error": "No engine is currently selected"}
457
458 try:
459 print(f"Setting voice to {voice_name}")
460 current_engine.set_voice(voice_name)
461 return {"message": f"Voice set to {voice_name} successfully"}
462 except Exception as e:
463 print(f"Error setting voice: {str(e)}")
464 logging.error(f"Error setting voice: {str(e)}")
465 return {"error": "Failed to set voice"}
466
467
468@app.get("/")

Callers

nothing calls this directly

Calls 1

set_voiceMethod · 0.45

Tested by

no test coverage detected