D-Bus service providing speech-to-text functionality for GNOME Shell
Project description
GNOME Speech2Text Service
A D-Bus service that provides speech-to-text functionality for the GNOME Shell Speech2Text extension.
Overview
This service handles the actual speech recognition processing using OpenAI's Whisper API. It runs as a D-Bus service and communicates with the GNOME Shell extension to provide seamless speech-to-text functionality.
Features
- Real-time speech recognition using OpenAI Whisper
- D-Bus integration for seamless desktop integration
- Audio recording with configurable duration
- Multiple output modes (clipboard, text insertion, preview)
- Error handling and recovery
- Session management for multiple concurrent recordings
Installation
System Dependencies
This service requires several system packages to be installed:
# Ubuntu/Debian
sudo apt update && sudo apt install -y \
python3 python3-pip python3-venv python3-dbus python3-gi \
ffmpeg xdotool xclip wl-clipboard
Service Installation
The service can be installed via pip:
pip install gnome-speech2text-service
Or from the source repository:
cd service/
pip install .
D-Bus Registration
After installation, you need to register the D-Bus service:
# Run the provided install script
./install.sh
This will:
- Set up the Python virtual environment
- Install the service in the correct location
- Register the D-Bus service files
- Configure the desktop integration
Usage
Starting the Service
The service is automatically started by D-Bus when needed. You can also start it manually:
gnome-speech2text-service
Configuration
The service uses OpenAI's API for speech recognition. You'll need to:
- Get an OpenAI API key from OpenAI Platform
- Configure it through the GNOME Shell extension preferences
D-Bus Interface
The service provides the following D-Bus methods:
StartRecording(duration, copy_to_clipboard, preview_mode)→recording_idStopRecording(recording_id)→successGetRecordingStatus(recording_id)→status, progressCancelRecording(recording_id)→success
Signals:
TranscriptionReady(recording_id, text)RecordingProgress(recording_id, progress)RecordingError(recording_id, error_message)
Development
Local Development
# Clone the repository
git clone https://github.com/kavehtehrani/gnome-speech2text.git
cd gnome-speech2text/service/
# Install in development mode
pip install -e .
# Run the service
gnome-speech2text-service
Testing
# Install development dependencies
pip install -e .[dev]
# Run tests
pytest
Requirements
- Python: 3.8 or higher
- System: Linux with D-Bus support
- Desktop: GNOME Shell (tested on GNOME 46+)
- API: OpenAI API key for speech recognition
License
This project is licensed under the GPL-2.0-or-later license. See the LICENSE file for details.
Contributing
Contributions are welcome! Please see the main repository for contribution guidelines: https://github.com/kavehtehrani/gnome-speech2text
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gnome_speech2text_service-1.0.1.tar.gz.
File metadata
- Download URL: gnome_speech2text_service-1.0.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f36f34081129405c3085e3a2c43b67066a538d2f95fdea428e18fa626949d5ee
|
|
| MD5 |
8dbbeedb84dc4adf34f64c52151f845c
|
|
| BLAKE2b-256 |
6339737285c4b5f134f3f556e4bb98ea6848460187c142d3f0850a56325188a7
|
File details
Details for the file gnome_speech2text_service-1.0.1-py3-none-any.whl.
File metadata
- Download URL: gnome_speech2text_service-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1788ea81add6bfc70df553621c6a8e1f52f885eced440df4ddd0f5c6487c3ad
|
|
| MD5 |
e70357f9b87da98237685dd60232c243
|
|
| BLAKE2b-256 |
0b9541f99e58436929cbc95681f0b8598039c8031759324afed13f4b7c9e642f
|