Voicegain Speech-to-Text Python SDK
Python SDK for the Voicegain Speech-to-Text API.
This API allows for large vocabulary speech-to-text transcription as well as grammar-based speech recognition. Both real-time and offline use cases are supported.
You can see the core Voicegain API documentation here.
The complete documentation for the API covered by this SDK is available here - this link requires an account on the Voicegain portal - see below for how to sign up.
Requirements
In order to use this API you need account with Voicegain. You can create an account by signing up on Voicegain Portal. No credit card required to sign up.
You can see pricing here - basically, it is 1 cent a minute for off-line and 1.25 cents a minute for real-time. There is a Free Tier of 600 minutes that renews each month.
Installation
From PyPI directly:
pip install voicegain_speech
Examples
- sync_transcribe example:
configuration:
from voicegain_speech import ApiClient
from voicegain_speech import Configuration
from voicegain_speech import TranscribeApi
import base64
# configure your JWT token
JWT = "Your <JWT>"
configuration = Configuration()
configuration.access_token = JWT
api_client = ApiClient(configuration=configuration)
transcribe local file:
transcribe_api = TranscribeApi(api_client)
file_path = "Your local file path"
with open(file_path, "rb") as f:
audio_base64 = base64.b64encode(f.read()).decode()
response = transcribe_api.asr_transcribe_post(
sync_transcription_request={
"audio": {
"source": {
"inline": {
"data": audio_base64
}
}
}
}
)
alternatives = response.result.alternatives
if alternatives:
local_result = alternatives[0].utterance
print("result from file: ", local_result)
else:
local_result = None
print("no transcription")
More examples can be found in examples folder on our GitHub
Learn more about the Voicegain Voice AI Platform at www.voicegain.ai
Metadata
Release files for voicegain-speech 1.142.0
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 | Actions |
|---|---|---|---|---|
| voicegain_speech-1.142.0.tar.gz | 9.2 MB | Without provenance | Details for voicegain_speech-1.142.0.tar.gz |
Release files / voicegain_speech-1.142.0.tar.gz
| Download URL | voicegain_speech-1.142.0.tar.gz |
|---|---|
| Size | 9.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
277373ef435d557689074c49f3d2d6077eaa4e0c8e39effadc7681875cc2c86c
|
|
BLAKE2b-256 checksum How to use checksums |
39b022580f3dbb5067ee1e66a70c91c0b96455697688b138786a5e52ab51604f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Security for voicegain-speech 1.142.0
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.