60db
Official 60db SDK for Python
Installation
pip install 60db
Quick Start
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()
API Methods
Text-to-Speech
text_to_speech(text, voice_id=None, **params)– Convert text to speech
Speech-to-Text
speech_to_text(audio_file, language=None)– Transcribe audioget_languages()– Get supported languages
Voices
get_voices()– List all voices
Example: Speech to Text
from 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)
License
MIT
Metadata
Release files for 60db 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| 60db-1.0.8.tar.gz | 5.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 60db-1.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / 60db-1.0.8.tar.gz
| Download URL | 60db-1.0.8.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f8ebdcb38d25cb6b9804c1b5c9ab4a038a93462e17b73def9fe0d18decc0830
|
|
BLAKE2b-256 checksum How to use checksums |
2ac2c06d7713f62a9be517484ee7d804c3bb52279a3a2cf0a27bec0ee10dce9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / 60db-1.0.8-py3-none-any.whl
| Download URL | 60db-1.0.8-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b36161339f465eef659d130835d230cff495e0062eae19a232bb78ea0cb41c8
|
|
BLAKE2b-256 checksum How to use checksums |
1fb36477dcaa2ee3b0121a9b30fb38cc2a123e281de17a4dade78b69697b5c64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for 60db 1.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.