Skip to main content

Pipecat service integration for Gnani speech AI — STT & TTS for Indian languages

Project description

pipecat-gnani

PyPI License

Pipecat service integration for Gnani — high-accuracy Speech-to-Text and low-latency Text-to-Speech for Indian languages.

Gnani is a production-ready speech AI platform supporting 10+ Indian languages with 6 voices, real-time streaming, multilingual transcription, and code-switching capabilities.

Installation

pip install pipecat-gnani

This will also install the gnani (>= 0.6.0) core SDK as a dependency.

Prerequisites

You need a Gnani API key. Email speechstack@gnani.ai to get started — all new accounts receive free credits, no credit card required.

export GNANI_API_KEY="your-api-key"

Quick Start

Speech-to-Text (REST)

from pipecat_gnani import GnaniHttpSTTService
from pipecat.transcriptions.language import Language

stt = GnaniHttpSTTService(
    api_key="your-api-key",
    aiohttp_session=session,
    settings=GnaniHttpSTTService.Settings(
        language=Language.HI_IN,
    ),
)

Speech-to-Text (Streaming WebSocket)

from pipecat_gnani import GnaniSTTService
from pipecat.transcriptions.language import Language

stt = GnaniSTTService(
    api_key="your-api-key",
    settings=GnaniSTTService.Settings(
        language=Language.HI_IN,
    ),
)

Text-to-Speech (REST)

from pipecat_gnani import GnaniHttpTTSService

tts = GnaniHttpTTSService(
    api_key="your-api-key",
    aiohttp_session=session,
    settings=GnaniHttpTTSService.Settings(
        voice="Karan",
    ),
)

Text-to-Speech (SSE Streaming)

from pipecat_gnani import GnaniSSETTSService

tts = GnaniSSETTSService(
    api_key="your-api-key",
    aiohttp_session=session,
    settings=GnaniSSETTSService.Settings(
        voice="Karan",
    ),
)

Text-to-Speech (WebSocket Streaming)

from pipecat_gnani import GnaniTTSService

tts = GnaniTTSService(
    api_key="your-api-key",
    settings=GnaniTTSService.Settings(
        voice="Karan",
    ),
)

Services

STT Services

Service Transport Base Class Description
GnaniHttpSTTService REST POST SegmentedSTTService File-based transcription via POST /stt/v3. Requires VAD in pipeline.
GnaniSTTService WebSocket STTService Real-time streaming via wss://api.vachana.ai/stt/v3/stream with VAD events.

Streaming PCM Specification

All streaming audio must be sent as raw PCM binary frames — no container format (WAV, MP3) mid-stream.

Property 16 kHz 8 kHz
Encoding PCM signed 16-bit little-endian PCM signed 16-bit little-endian
Sample Rate 16,000 Hz 8,000 Hz
Channels 1 (mono) 1 (mono)
Samples per chunk 512 512
Bytes per frame 1,024 bytes (512 samples × 2 bytes) 1,024 bytes (512 samples × 2 bytes)
Frame duration 32 ms 64 ms

Frames must be sent at real-time cadence. See STT Realtime — PCM Specification for full details.

TTS Services

Service Transport Base Class Description
GnaniHttpTTSService REST POST TTSService Single-request synthesis via POST /api/v1/tts/inference.
GnaniSSETTSService SSE TTSService Streaming synthesis via POST /api/v1/tts/sse. Lower latency than REST.
GnaniTTSService WebSocket InterruptibleTTSService Streaming via wss://api.vachana.ai/api/v1/tts. Lowest latency, interruption support.

Supported Languages

STT Languages (Speech-to-Text)

STT uses BCP-47 locale codes (e.g. hi-IN).

Language Code
Assamese as-IN
Bengali bn-IN
English (India) en-IN
Gujarati gu-IN
Hindi hi-IN
Kannada kn-IN
Malayalam ml-IN
Marathi mr-IN
Odia or-IN
Punjabi pa-IN
Tamil ta-IN
Telugu te-IN

TTS Languages (Text-to-Speech)

TTS uses ISO 639 language codes (e.g. hi, bn). Note: TTS does not use the -IN suffix.

For the full list of supported languages, see TTS — Supported Languages.

Available Voices

Voice Gender Description
Karan Male Bold, Trustworthy
Simran Female Confident, Bright
Nara Female Gentle, Expressive
Riya Female Cheerful, Energetic
Viraj Male Commanding, Dynamic
Raju Male Grounded, Conversational

Architecture

gnani (>=0.6.0)          ← Core SDK (REST, SSE, WebSocket clients)
        ↑
pipecat-gnani            ← This package (Pipecat service adapters)
  ├── STT: REST + WebSocket
  └── TTS: REST + SSE + WebSocket

This package wraps the gnani SDK into Pipecat's SegmentedSTTService, STTService, TTSService, and InterruptibleTTSService base classes.

Documentation

License

BSD 2-Clause — see LICENSE.

Project details


Download files

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

Source Distribution

pipecat_gnani-0.5.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipecat_gnani-0.5.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file pipecat_gnani-0.5.0.tar.gz.

File metadata

  • Download URL: pipecat_gnani-0.5.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pipecat_gnani-0.5.0.tar.gz
Algorithm Hash digest
SHA256 30d0b1d207fc8f6b716e2a7b866a611411df17319ea9bc1c2c09ca2b9218607e
MD5 3ef9f48379cc05d76e94f00fe204cc06
BLAKE2b-256 82713e29a8e30428743eb13b559be9bb6e4f1fb6d373ab9df8c952f8c545a8ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipecat_gnani-0.5.0.tar.gz:

Publisher: workflow.yml on Gnani-AI-Mintlify/pipecat-gnani

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipecat_gnani-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pipecat_gnani-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pipecat_gnani-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e6465e596a558c30bea0fce3ce3e9f9d3d1cd628b6095ccfa108f5592117f8a
MD5 4a2a414a2dd9ef483ab345ec22a066ca
BLAKE2b-256 dbe540adeb178f60b8a51b4efe22bbee750264ad24ae857fa784b585d761390e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipecat_gnani-0.5.0-py3-none-any.whl:

Publisher: workflow.yml on Gnani-AI-Mintlify/pipecat-gnani

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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