Current collected state Current
Observed since 20 Oct, 16:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
60db
Official 60db SDK for Python
Official 60db SDK for Python
pip install 60db
from sixtydb import SixtyDBClient
def fetch_and_display_voices(client: SixtyDBClient) -> str:
"""
Fetch all available voices and print their details.
Returns:
str: Selected voice_id
"""
try:
response = client.get_voices()
except Exception as exc:
print("Error fetching voices:", exc)
raise
if not response.get("success"):
raise Exception(response.get("message"))
voices = response["data"]["built_in_voices"]
if not voices:
raise Exception("No voices available.")
print("\nAvailable Voices:\n" + "-" * 40)
for voice in voices:
print(
f"Name: {voice.get('name')} | "
f"Voice ID: {voice.get('voice_id')} | "
f"Language: {voice.get('language_name')} | "
f"Gender: {voice.get('gender')}"
)
return voices[0]["voice_id"]
def generate_speech(client: SixtyDBClient, voice_id: str) -> None:
"""
Generate speech and save to file.
"""
try:
audio = client.text_to_speech(
text="Hello, world!",
voice_id=voice_id,
speed=1.0
)
with open("output.mp3", "wb") as file:
file.write(audio)
print("\nAudio saved to output.mp3")
except Exception as exc:
print("Error generating speech:", exc)
raise
def main() -> None:
try:
client = SixtyDBClient("your-api-key")
except Exception as exc:
print("Error creating client:", exc)
return
try:
voice_id = fetch_and_display_voices(client)
generate_speech(client, voice_id)
except Exception as exc:
print("Operation failed:", exc)
if __name__ == "__main__":
main()
text_to_speech(text, voice_id=None, **params) – Convert text to speechspeech_to_text(audio_file, language=None) – Transcribe audioget_languages() – Get supported languagesget_voices() – List all voicesfrom sixtydb import SixtyDBClient
client = SixtyDBClient("your-api-key")
try:
with open("output.mp3", "rb") as file:
result = client.speech_to_text(file, language="en")
if result.get("success"):
print("Transcription:", result["data"]["text"])
else:
print("STT Error:", result.get("message"))
except Exception as exc:
print("Error during transcription:", exc)
MIT
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
requestsEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | requests>=2.28.0 | runtime |
typing-extensionsEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | typing-extensions>=4.0.0 | runtime |
bdist_wheel · 4.89 KB · Python py3
sdist · 4.86 KB · Python source
Observed since 20 Oct, 16:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:cd2e0228686e95b7c17264bfb0638264b72d75a09b5703bec81483035f4b7835