Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Vernacular Speech API python client

Project description

Python Speech to Text SDK

Python SDK for vernacular.ai speech to text APIs. Go here for detailed product documentation.

Installation

To install this sdk run:

pip install vernacular-ai-speech

Supported Python Versions

Python >= 3.5

Example Usage

from vernacular.ai import speech
from vernacular.ai.speech import enums, types


def sample_recognize(access_token, file_path):
    """
    Args:
        access_token Token provided by vernacular.ai for authentication
        file_path Path to audio file e.g /path/audio_file.wav
    """
    speech_client = speech.SpeechClient(access_token)

    audio = types.RecognitionAudio(
        content = open(file_path, "rb").read()
    )

    config = types.RecognitionConfig(
        encoding=enums.RecognitionConfig.AudioEncoding.LINEAR16,
        sample_rate_hertz=8000,
        language_code = "hi-IN",
    )

    response = speech_client.recognize(audio=audio, config=config)

    for result in response.results:
        alternative = result.alternatives[0]
        print("Transcript: {}".format(alternative.transcript))

To see more examples, go to samples.

Project details


Download files

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

Files for vernacular-ai-speech, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size vernacular_ai_speech-0.1.0-py3-none-any.whl (13.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size vernacular-ai-speech-0.1.0.tar.gz (12.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page