Skip to main content

Voicegain Speech-to-Text Python SDK

Project description

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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

voicegain-speech-1.109.1.tar.gz (7.0 MB view details)

Uploaded Source

File details

Details for the file voicegain-speech-1.109.1.tar.gz.

File metadata

  • Download URL: voicegain-speech-1.109.1.tar.gz
  • Upload date:
  • Size: 7.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.9.6 requests/2.31.0 setuptools/59.6.0 requests-toolbelt/1.0.0 tqdm/4.66.1 CPython/3.10.12

File hashes

Hashes for voicegain-speech-1.109.1.tar.gz
Algorithm Hash digest
SHA256 ad436ff83af68c51c75a5ceb64501b65768721ebdbb7bae0eefe2d907c65c7b8
MD5 9f82b06907f68fa9b70aba77c3af8310
BLAKE2b-256 aaacc871d2c09860c8b9ec0bf7f9c950aa250c5c5d8194155056abd33ee035e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page