tsclient


Nametsclient JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/Talkscriber/ts-client
SummaryPython client library for Talkscriber Live Transcription and Text-to-Speech services
upload_time2025-10-19 15:21:44
maintainerNone
docs_urlNone
authorTalkscriber
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Talkscriber Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords talkscriber speech-to-text text-to-speech transcription tts stt websocket real-time audio speech
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TSClient - Talkscriber Python Client

[![PyPI version](https://badge.fury.io/py/tsclient.svg)](https://badge.fury.io/py/tsclient)
[![Python Support](https://img.shields.io/pypi/pyversions/tsclient.svg)](https://pypi.org/project/tsclient/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://pepy.tech/badge/tsclient)](https://pepy.tech/project/tsclient)
[![GitHub stars](https://img.shields.io/github/stars/Talkscriber/ts-client.svg)](https://github.com/Talkscriber/ts-client)

A comprehensive Python client library for Talkscriber's Live Transcription and Text-to-Speech services. This package provides easy-to-use APIs for real-time speech-to-text transcription and ultra-low latency text-to-speech conversion.

## Features

### Live Transcription
- Real-time speech-to-text transcription via WebSocket
- Support for 50+ languages
- Smart turn detection using ML models
- Translation capabilities
- File and microphone input support

### Text-to-Speech
- Ultra-low latency streaming (speech starts in <0.1 seconds)
- Real-time audio playback
- Multiple voice options
- Audio file saving
- Configurable buffering for optimal performance

## Installation

### Quick Install

```bash
pip install tsclient
```

### System Dependencies

The package requires some system-level dependencies for audio processing:

**macOS:**
```bash
# Install PortAudio (required for PyAudio)
brew install portaudio

# Then install the package
pip install tsclient
```

**Ubuntu/Debian:**
```bash
# Install system dependencies
sudo apt-get update
sudo apt-get install libasound2-dev portaudio19-dev python3-dev

# Then install the package
pip install tsclient
```

**Windows:**
```bash
# No additional setup required - just install the package
pip install tsclient
```

**CentOS/RHEL/Fedora:**
```bash
# Install system dependencies
sudo yum install portaudio-devel python3-devel
# or for newer versions:
sudo dnf install portaudio-devel python3-devel

# Then install the package
pip install tsclient
```

### Development Install

For development or to run examples:

```bash
git clone https://github.com/Talkscriber/ts-client.git
cd ts-client
pip install -e .
```

## Quick Start

### Get Your API Key

1. Visit [Talkscriber Dashboard](https://app.talkscriber.com)
2. Sign up or log in
3. Generate an API key
4. Set it as an environment variable:

```bash
export TALKSCRIBER_API_KEY="your_api_key_here"
```

### Live Transcription

```python
from talkscriber.stt import TranscriptionClient

# Initialize client
client = TranscriptionClient(
    host="wss://api.talkscriber.com",
    port=9090,
    api_key="your_api_key",
    language="en"
)

# Start live transcription from microphone
client()

# Or transcribe from file
client("audio_file.wav")
```

### Text-to-Speech

```python
from talkscriber.tts import TalkScriberTTSClient

# Initialize TTS client
tts_client = TalkScriberTTSClient(
    api_key="your_api_key",
    text="Hello, world!",
    speaker_name="tara"
)

# Generate and play speech
tts_client.run_simple_test()
```

## Command Line Interface

The package includes convenient CLI tools:

### Live Transcription CLI

```bash
# Transcribe from microphone
talkscriber-stt --api-key YOUR_KEY --language en

# Transcribe from file
talkscriber-stt --api-key YOUR_KEY --file audio.wav

# Enable multilingual detection
talkscriber-stt --api-key YOUR_KEY --multilingual
```

### Text-to-Speech CLI

```bash
# Basic TTS
talkscriber-tts --api-key YOUR_KEY --text "Hello, world!"

# Save to file
talkscriber-tts --api-key YOUR_KEY --text "Hello" --save output.wav

# Use specific voice
talkscriber-tts --api-key YOUR_KEY --text "Hello" --speaker tara
```

## API Reference

### Live Transcription

#### TranscriptionClient

```python
TranscriptionClient(
    host: str,
    port: int,
    api_key: str,
    multilingual: bool = False,
    language: str = None,
    translate: bool = False,
    enable_turn_detection: bool = False,
    turn_detection_timeout: float = 0.6
)
```

**Parameters:**
- `host`: WebSocket host URL
- `port`: WebSocket port number
- `api_key`: Your Talkscriber API key
- `multilingual`: Enable auto language detection
- `language`: Language code (e.g., "en", "es", "fr")
- `translate`: Enable translation
- `enable_turn_detection`: Enable ML-based turn detection
- `turn_detection_timeout`: Timeout for turn detection

### Text-to-Speech

#### TalkScriberTTSClient

```python
TalkScriberTTSClient(
    host: str = "api.talkscriber.com",
    port: int = 9099,
    text: str,
    speaker_name: str = "tara",
    api_key: str,
    enable_playback: bool = True,
    save_audio_path: str = None
)
```

**Parameters:**
- `host`: TTS server hostname
- `port`: TTS server port
- `text`: Text to convert to speech
- `speaker_name`: Voice to use
- `api_key`: Your Talkscriber API key
- `enable_playback`: Enable real-time audio playback
- `save_audio_path`: Optional path to save audio file

## Supported Languages

The client supports 50+ languages including English, Spanish, French, German, Chinese, Japanese, and many more. See the [full language list](https://docs.talkscriber.com/languages) in our documentation.

## Examples

Check out the `examples/` directory for comprehensive examples organized by category:

### Quick Start
```bash
# First, install the package
pip install tsclient

# Then run examples
# Interactive demo (recommended for beginners)
python examples/integration/comprehensive_demo.py

# Basic STT (microphone)
python examples/stt/basic.py

# Basic TTS (text-to-speech)
python examples/tts/basic.py
```

### Example Categories

**Speech-to-Text (STT):**
- **`stt/basic.py`** - Real-time microphone transcription
- **`stt/file.py`** - Transcribe audio files
- **`stt/multilingual.py`** - Automatic language detection

**Text-to-Speech (TTS):**
- **`tts/basic.py`** - Basic TTS with real-time playback
- **`tts/save_file.py`** - Generate and save audio files
- **`tts/silent.py`** - Silent TTS generation
- **`tts/different_voices.py`** - Multiple voice comparison
- **`tts/batch.py`** - Batch processing from text files

**Integration:**
- **`integration/stt_to_tts.py`** - Complete voice processing pipeline
- **`integration/comprehensive_demo.py`** - Interactive demo

**Configuration:**
- **`configuration/config_patterns.py`** - Configuration patterns and best practices

See the [examples README](examples/README.md) for detailed usage instructions and the complete directory structure.

## Documentation

- [Full Documentation](https://docs.talkscriber.com)
- [API Reference](https://docs.talkscriber.com/api)
- [Language Support](https://docs.talkscriber.com/languages)

## Links

- [Talkscriber Dashboard](https://app.talkscriber.com) - Get your API key
- [Official Website](https://talkscriber.com)
- [GitHub Repository](https://github.com/Talkscriber/ts-client)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Talkscriber/ts-client",
    "name": "tsclient",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Talkscriber <support@talkscriber.com>",
    "keywords": "talkscriber, speech-to-text, text-to-speech, transcription, tts, stt, websocket, real-time, audio, speech",
    "author": "Talkscriber",
    "author_email": "Talkscriber <support@talkscriber.com>",
    "download_url": "https://files.pythonhosted.org/packages/26/57/7e697651e180db0c895bde8fad472b67b9ac675aa991aa1289495a7f4d16/tsclient-1.0.1.tar.gz",
    "platform": null,
    "description": "# TSClient - Talkscriber Python Client\n\n[![PyPI version](https://badge.fury.io/py/tsclient.svg)](https://badge.fury.io/py/tsclient)\n[![Python Support](https://img.shields.io/pypi/pyversions/tsclient.svg)](https://pypi.org/project/tsclient/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://pepy.tech/badge/tsclient)](https://pepy.tech/project/tsclient)\n[![GitHub stars](https://img.shields.io/github/stars/Talkscriber/ts-client.svg)](https://github.com/Talkscriber/ts-client)\n\nA comprehensive Python client library for Talkscriber's Live Transcription and Text-to-Speech services. This package provides easy-to-use APIs for real-time speech-to-text transcription and ultra-low latency text-to-speech conversion.\n\n## Features\n\n### Live Transcription\n- Real-time speech-to-text transcription via WebSocket\n- Support for 50+ languages\n- Smart turn detection using ML models\n- Translation capabilities\n- File and microphone input support\n\n### Text-to-Speech\n- Ultra-low latency streaming (speech starts in <0.1 seconds)\n- Real-time audio playback\n- Multiple voice options\n- Audio file saving\n- Configurable buffering for optimal performance\n\n## Installation\n\n### Quick Install\n\n```bash\npip install tsclient\n```\n\n### System Dependencies\n\nThe package requires some system-level dependencies for audio processing:\n\n**macOS:**\n```bash\n# Install PortAudio (required for PyAudio)\nbrew install portaudio\n\n# Then install the package\npip install tsclient\n```\n\n**Ubuntu/Debian:**\n```bash\n# Install system dependencies\nsudo apt-get update\nsudo apt-get install libasound2-dev portaudio19-dev python3-dev\n\n# Then install the package\npip install tsclient\n```\n\n**Windows:**\n```bash\n# No additional setup required - just install the package\npip install tsclient\n```\n\n**CentOS/RHEL/Fedora:**\n```bash\n# Install system dependencies\nsudo yum install portaudio-devel python3-devel\n# or for newer versions:\nsudo dnf install portaudio-devel python3-devel\n\n# Then install the package\npip install tsclient\n```\n\n### Development Install\n\nFor development or to run examples:\n\n```bash\ngit clone https://github.com/Talkscriber/ts-client.git\ncd ts-client\npip install -e .\n```\n\n## Quick Start\n\n### Get Your API Key\n\n1. Visit [Talkscriber Dashboard](https://app.talkscriber.com)\n2. Sign up or log in\n3. Generate an API key\n4. Set it as an environment variable:\n\n```bash\nexport TALKSCRIBER_API_KEY=\"your_api_key_here\"\n```\n\n### Live Transcription\n\n```python\nfrom talkscriber.stt import TranscriptionClient\n\n# Initialize client\nclient = TranscriptionClient(\n    host=\"wss://api.talkscriber.com\",\n    port=9090,\n    api_key=\"your_api_key\",\n    language=\"en\"\n)\n\n# Start live transcription from microphone\nclient()\n\n# Or transcribe from file\nclient(\"audio_file.wav\")\n```\n\n### Text-to-Speech\n\n```python\nfrom talkscriber.tts import TalkScriberTTSClient\n\n# Initialize TTS client\ntts_client = TalkScriberTTSClient(\n    api_key=\"your_api_key\",\n    text=\"Hello, world!\",\n    speaker_name=\"tara\"\n)\n\n# Generate and play speech\ntts_client.run_simple_test()\n```\n\n## Command Line Interface\n\nThe package includes convenient CLI tools:\n\n### Live Transcription CLI\n\n```bash\n# Transcribe from microphone\ntalkscriber-stt --api-key YOUR_KEY --language en\n\n# Transcribe from file\ntalkscriber-stt --api-key YOUR_KEY --file audio.wav\n\n# Enable multilingual detection\ntalkscriber-stt --api-key YOUR_KEY --multilingual\n```\n\n### Text-to-Speech CLI\n\n```bash\n# Basic TTS\ntalkscriber-tts --api-key YOUR_KEY --text \"Hello, world!\"\n\n# Save to file\ntalkscriber-tts --api-key YOUR_KEY --text \"Hello\" --save output.wav\n\n# Use specific voice\ntalkscriber-tts --api-key YOUR_KEY --text \"Hello\" --speaker tara\n```\n\n## API Reference\n\n### Live Transcription\n\n#### TranscriptionClient\n\n```python\nTranscriptionClient(\n    host: str,\n    port: int,\n    api_key: str,\n    multilingual: bool = False,\n    language: str = None,\n    translate: bool = False,\n    enable_turn_detection: bool = False,\n    turn_detection_timeout: float = 0.6\n)\n```\n\n**Parameters:**\n- `host`: WebSocket host URL\n- `port`: WebSocket port number\n- `api_key`: Your Talkscriber API key\n- `multilingual`: Enable auto language detection\n- `language`: Language code (e.g., \"en\", \"es\", \"fr\")\n- `translate`: Enable translation\n- `enable_turn_detection`: Enable ML-based turn detection\n- `turn_detection_timeout`: Timeout for turn detection\n\n### Text-to-Speech\n\n#### TalkScriberTTSClient\n\n```python\nTalkScriberTTSClient(\n    host: str = \"api.talkscriber.com\",\n    port: int = 9099,\n    text: str,\n    speaker_name: str = \"tara\",\n    api_key: str,\n    enable_playback: bool = True,\n    save_audio_path: str = None\n)\n```\n\n**Parameters:**\n- `host`: TTS server hostname\n- `port`: TTS server port\n- `text`: Text to convert to speech\n- `speaker_name`: Voice to use\n- `api_key`: Your Talkscriber API key\n- `enable_playback`: Enable real-time audio playback\n- `save_audio_path`: Optional path to save audio file\n\n## Supported Languages\n\nThe client supports 50+ languages including English, Spanish, French, German, Chinese, Japanese, and many more. See the [full language list](https://docs.talkscriber.com/languages) in our documentation.\n\n## Examples\n\nCheck out the `examples/` directory for comprehensive examples organized by category:\n\n### Quick Start\n```bash\n# First, install the package\npip install tsclient\n\n# Then run examples\n# Interactive demo (recommended for beginners)\npython examples/integration/comprehensive_demo.py\n\n# Basic STT (microphone)\npython examples/stt/basic.py\n\n# Basic TTS (text-to-speech)\npython examples/tts/basic.py\n```\n\n### Example Categories\n\n**Speech-to-Text (STT):**\n- **`stt/basic.py`** - Real-time microphone transcription\n- **`stt/file.py`** - Transcribe audio files\n- **`stt/multilingual.py`** - Automatic language detection\n\n**Text-to-Speech (TTS):**\n- **`tts/basic.py`** - Basic TTS with real-time playback\n- **`tts/save_file.py`** - Generate and save audio files\n- **`tts/silent.py`** - Silent TTS generation\n- **`tts/different_voices.py`** - Multiple voice comparison\n- **`tts/batch.py`** - Batch processing from text files\n\n**Integration:**\n- **`integration/stt_to_tts.py`** - Complete voice processing pipeline\n- **`integration/comprehensive_demo.py`** - Interactive demo\n\n**Configuration:**\n- **`configuration/config_patterns.py`** - Configuration patterns and best practices\n\nSee the [examples README](examples/README.md) for detailed usage instructions and the complete directory structure.\n\n## Documentation\n\n- [Full Documentation](https://docs.talkscriber.com)\n- [API Reference](https://docs.talkscriber.com/api)\n- [Language Support](https://docs.talkscriber.com/languages)\n\n## Links\n\n- [Talkscriber Dashboard](https://app.talkscriber.com) - Get your API key\n- [Official Website](https://talkscriber.com)\n- [GitHub Repository](https://github.com/Talkscriber/ts-client)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 Talkscriber\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Python client library for Talkscriber Live Transcription and Text-to-Speech services",
    "version": "1.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/Talkscriber/ts-client/issues",
        "Dashboard": "https://app.talkscriber.com",
        "Documentation": "https://docs.talkscriber.com",
        "Homepage": "https://talkscriber.com",
        "Repository": "https://github.com/Talkscriber/ts-client"
    },
    "split_keywords": [
        "talkscriber",
        " speech-to-text",
        " text-to-speech",
        " transcription",
        " tts",
        " stt",
        " websocket",
        " real-time",
        " audio",
        " speech"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5cf08f53cf659f2592e0f125a6c49d4a1704fcb05a1311e80b9c55b778a9c22e",
                "md5": "b44c3e0ee3503f690e89c81f408d3b5c",
                "sha256": "2b2a0cc1d8615eebf227137922ad3dc235a34d58f8bc722433713aaec22e4d08"
            },
            "downloads": -1,
            "filename": "tsclient-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b44c3e0ee3503f690e89c81f408d3b5c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 20986,
            "upload_time": "2025-10-19T15:21:43",
            "upload_time_iso_8601": "2025-10-19T15:21:43.086860Z",
            "url": "https://files.pythonhosted.org/packages/5c/f0/8f53cf659f2592e0f125a6c49d4a1704fcb05a1311e80b9c55b778a9c22e/tsclient-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "26577e697651e180db0c895bde8fad472b67b9ac675aa991aa1289495a7f4d16",
                "md5": "2d173f90b1e488595be7a658ea3ca896",
                "sha256": "9e35bbec0d6fd013627ff3fdb92686d846710d8e57d8acd3478f9d66aa6adb7d"
            },
            "downloads": -1,
            "filename": "tsclient-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2d173f90b1e488595be7a658ea3ca896",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 580991,
            "upload_time": "2025-10-19T15:21:44",
            "upload_time_iso_8601": "2025-10-19T15:21:44.658978Z",
            "url": "https://files.pythonhosted.org/packages/26/57/7e697651e180db0c895bde8fad472b67b9ac675aa991aa1289495a7f4d16/tsclient-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-19 15:21:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Talkscriber",
    "github_project": "ts-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tsclient"
}
        
Elapsed time: 0.95933s