Skip to main content

Pipecat plugin for Munsit Arabic speech-to-text and text-to-speech

Project description

pipecat-plugins-munsit

Pipecat services for Munsit: Arabic speech-to-text (live WebSocket streaming) and text-to-speech (HTTP streaming).

This package supersedes pipecat-plugins-faseeh, which is now a deprecation shim that re-exports these services.

Installation

pip install pipecat-plugins-munsit

Requires Python 3.10+ and pipecat-ai >= 1.5.0.

Speech-to-Text (live streaming)

MunsitSTTService streams audio to Munsit's live WebSocket API (wss://api.munsit.com/api/v1/listen) and pushes interim and final transcription frames. Arabic only (v1).

from pipecat_plugins_munsit import MunsitSTTService

stt = MunsitSTTService(
    api_key="your-api-key",       # or MUNSIT_API_KEY env var
    endpointing_ms=800,           # server-side silence window that ends a turn (100-5000)
    hotwords=["فصيح", "منصت"],    # custom vocabulary biasing (<=200 entries, <=40 chars)
)

Per-turn enrichment (speaker gender, sentiment)

async def on_enrichment(event: dict):
    if event["type"] == "Gender":
        print("speaker gender:", event["label"], event["score"])
    elif event["type"] == "Sentiment":
        print("turn sentiment:", event["label"], event["score"])

stt = MunsitSTTService(api_key="...", on_enrichment=on_enrichment)

Notes

  • Input at 8 kHz / 16 kHz is sent as-is; other pipeline rates are resampled to 16 kHz client-side.
  • Idle connections are kept open with protocol KeepAlive control frames (never silence, which would be billed as audio).
  • A final with TranscriptionFrame.finalized == False is a forced split inside one long utterance (the server splits turns at ~60s of unbroken speech), not the end of the user's turn.
  • smart_turn (on by default) gates end-of-turn on the server's semantic turn-completion model, reducing premature cuts; pass smart_turn=False to end turns on silence alone.

Text-to-Speech

import aiohttp
from pipecat_plugins_munsit import MunsitTTSService

async with aiohttp.ClientSession() as session:
    tts = MunsitTTSService(
        api_key="your-api-key",   # or MUNSIT_API_KEY env var
        aiohttp_session=session,
        voice_id="ar-hijazi-female-2",
        model="faseeh-v1-preview",
    )

Streams PCM16 audio at 48 kHz mono by default (sample_rate=24000 also supported). stability (0.0-1.0) and speed (0.7-1.2) are configurable at construction and runtime-updatable via TTSUpdateSettingsFrame.

Full agent example

from pipecat.pipeline.pipeline import Pipeline
from pipecat_plugins_munsit import MunsitSTTService, MunsitTTSService

pipeline = Pipeline([
    transport.input(),
    MunsitSTTService(api_key="..."),
    context_aggregator.user(),
    llm,
    MunsitTTSService(api_key="...", aiohttp_session=session),
    transport.output(),
    context_aggregator.assistant(),
])

Development

pip install -e ".[dev]"
pytest tests/ -q

Releases are published to PyPI by pushing a v* tag (see .github/workflows/publish.yml; requires the PYPI_API_TOKEN repo secret).

License

Apache-2.0

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_plugins_munsit-0.2.0.tar.gz (21.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_plugins_munsit-0.2.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file pipecat_plugins_munsit-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for pipecat_plugins_munsit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2c1dc638a27eb78bef1a456ed1c1a184fe3e97b9a84cb769580922261476aebf
MD5 269a114b53ccc866c988fc6c04a3336d
BLAKE2b-256 ff3aaf9c7ad24b1dc0b1962b5de800f649a5edc990d92928de52a6fdea193cc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipecat_plugins_munsit-0.2.0.tar.gz:

Publisher: publish.yml on CNTXTFZCO0/pipecat-plugins-munsit

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_plugins_munsit-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pipecat_plugins_munsit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e91bbe0e181bf592805498d8c290c619a69ea109bed44cb45cd50825ceebb81
MD5 230829273dcd7f53948eb2803d289893
BLAKE2b-256 b678228d36f1aa37ff9d4c27d11d877cbd8e84d3534b32d6176afa065007eadc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipecat_plugins_munsit-0.2.0-py3-none-any.whl:

Publisher: publish.yml on CNTXTFZCO0/pipecat-plugins-munsit

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