abstractvoice 0.1.1__py3-none-any.whl → 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: abstractvoice
3
- Version: 0.1.1
3
+ Version: 0.2.1
4
4
  Summary: A modular Python library for voice interactions with AI systems
5
5
  Author-email: Laurent-Philippe Albou <contact@abstractcore.ai>
6
6
  License-Expression: MIT
@@ -18,31 +18,76 @@ Requires-Python: >=3.8
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
20
  Requires-Dist: numpy>=1.24.0
21
- Requires-Dist: sounddevice>=0.4.6
22
- Requires-Dist: webrtcvad>=2.0.10
23
- Requires-Dist: PyAudio>=0.2.13
24
- Requires-Dist: openai-whisper>=20230314
25
- Requires-Dist: coqui-tts>=0.27.0
26
- Requires-Dist: torch>=2.0.0
27
- Requires-Dist: torchaudio>=2.0.0
28
- Requires-Dist: librosa>=0.10.0
29
- Requires-Dist: soundfile>=0.12.1
30
21
  Requires-Dist: requests>=2.31.0
31
- Requires-Dist: flask>=2.0.0
32
- Requires-Dist: tiktoken>=0.6.0
22
+ Provides-Extra: voice
23
+ Requires-Dist: sounddevice>=0.4.6; extra == "voice"
24
+ Requires-Dist: webrtcvad>=2.0.10; extra == "voice"
25
+ Requires-Dist: PyAudio>=0.2.13; extra == "voice"
26
+ Requires-Dist: soundfile>=0.12.1; extra == "voice"
27
+ Provides-Extra: tts
28
+ Requires-Dist: coqui-tts<0.30.0,>=0.27.0; extra == "tts"
29
+ Requires-Dist: torch<2.4.0,>=2.0.0; extra == "tts"
30
+ Requires-Dist: torchvision<0.19.0,>=0.15.0; extra == "tts"
31
+ Requires-Dist: torchaudio<2.4.0,>=2.0.0; extra == "tts"
32
+ Requires-Dist: librosa<0.11.0,>=0.10.0; extra == "tts"
33
+ Provides-Extra: stt
34
+ Requires-Dist: openai-whisper>=20230314; extra == "stt"
35
+ Requires-Dist: tiktoken>=0.6.0; extra == "stt"
36
+ Provides-Extra: web
37
+ Requires-Dist: flask>=2.0.0; extra == "web"
38
+ Provides-Extra: all
39
+ Requires-Dist: sounddevice>=0.4.6; extra == "all"
40
+ Requires-Dist: webrtcvad>=2.0.10; extra == "all"
41
+ Requires-Dist: PyAudio>=0.2.13; extra == "all"
42
+ Requires-Dist: openai-whisper>=20230314; extra == "all"
43
+ Requires-Dist: coqui-tts<0.30.0,>=0.27.0; extra == "all"
44
+ Requires-Dist: torch<2.4.0,>=2.0.0; extra == "all"
45
+ Requires-Dist: torchvision<0.19.0,>=0.15.0; extra == "all"
46
+ Requires-Dist: torchaudio<2.4.0,>=2.0.0; extra == "all"
47
+ Requires-Dist: librosa<0.11.0,>=0.10.0; extra == "all"
48
+ Requires-Dist: soundfile>=0.12.1; extra == "all"
49
+ Requires-Dist: flask>=2.0.0; extra == "all"
50
+ Requires-Dist: tiktoken>=0.6.0; extra == "all"
33
51
  Provides-Extra: dev
34
52
  Requires-Dist: pytest>=7.0.0; extra == "dev"
35
53
  Requires-Dist: black>=22.0.0; extra == "dev"
36
54
  Requires-Dist: flake8>=5.0.0; extra == "dev"
55
+ Provides-Extra: voice-full
56
+ Requires-Dist: sounddevice>=0.4.6; extra == "voice-full"
57
+ Requires-Dist: webrtcvad>=2.0.10; extra == "voice-full"
58
+ Requires-Dist: PyAudio>=0.2.13; extra == "voice-full"
59
+ Requires-Dist: openai-whisper>=20230314; extra == "voice-full"
60
+ Requires-Dist: coqui-tts<0.30.0,>=0.27.0; extra == "voice-full"
61
+ Requires-Dist: torch<2.4.0,>=2.0.0; extra == "voice-full"
62
+ Requires-Dist: torchvision<0.19.0,>=0.15.0; extra == "voice-full"
63
+ Requires-Dist: torchaudio<2.4.0,>=2.0.0; extra == "voice-full"
64
+ Requires-Dist: librosa<0.11.0,>=0.10.0; extra == "voice-full"
65
+ Requires-Dist: soundfile>=0.12.1; extra == "voice-full"
66
+ Requires-Dist: tiktoken>=0.6.0; extra == "voice-full"
67
+ Provides-Extra: core-tts
68
+ Requires-Dist: coqui-tts<0.30.0,>=0.27.0; extra == "core-tts"
69
+ Requires-Dist: torch<2.4.0,>=2.0.0; extra == "core-tts"
70
+ Requires-Dist: torchvision<0.19.0,>=0.15.0; extra == "core-tts"
71
+ Requires-Dist: torchaudio<2.4.0,>=2.0.0; extra == "core-tts"
72
+ Requires-Dist: librosa<0.11.0,>=0.10.0; extra == "core-tts"
73
+ Provides-Extra: core-stt
74
+ Requires-Dist: openai-whisper>=20230314; extra == "core-stt"
75
+ Requires-Dist: tiktoken>=0.6.0; extra == "core-stt"
76
+ Provides-Extra: audio-only
77
+ Requires-Dist: sounddevice>=0.4.6; extra == "audio-only"
78
+ Requires-Dist: webrtcvad>=2.0.10; extra == "audio-only"
79
+ Requires-Dist: PyAudio>=0.2.13; extra == "audio-only"
80
+ Requires-Dist: soundfile>=0.12.1; extra == "audio-only"
37
81
  Dynamic: license-file
38
82
 
39
83
  # AbstractVoice
40
84
 
41
85
  [![PyPI version](https://img.shields.io/pypi/v/abstractvoice.svg)](https://pypi.org/project/abstractvoice/)
42
86
  [![Python Version](https://img.shields.io/pypi/pyversions/abstractvoice)](https://pypi.org/project/abstractvoice/)
43
- [![License](https://img.shields.io/pypi/l/abstractvoice)](https://github.com/lpalbou/abstractvoice/blob/main/LICENSE)
87
+ [![license](https://img.shields.io/github/license/lpalbou/AbstractVoice)](https://github.com/lpalbou/abstractvoice/blob/main/LICENSE)
44
88
  [![GitHub stars](https://img.shields.io/github/stars/lpalbou/abstractvoice?style=social)](https://github.com/lpalbou/abstractvoice/stargazers)
45
89
 
90
+
46
91
  A modular Python library for voice interactions with AI systems, providing text-to-speech (TTS) and speech-to-text (STT) capabilities with interrupt handling.
47
92
 
48
93
  While we provide CLI and WEB examples, AbstractVoice is designed to be integrated in other projects.
@@ -62,73 +107,174 @@ While we provide CLI and WEB examples, AbstractVoice is designed to be integrate
62
107
  - **Interrupt Handling**: Stop TTS by speaking or using stop commands
63
108
  - **Modular Design**: Easily integrate with any text generation system
64
109
 
110
+ Note : *the LLM access is rudimentary and abstractvoice is provided more as an example and demonstrator. A better integration is to use the functionalities of this library and use them directly in combination with [AbstractCore](https://github.com/lpalbou/AbstractCore)*.
111
+
65
112
  ## Installation
66
113
 
67
- ### Prerequisites
114
+ AbstractVoice is designed to **work everywhere, out of the box** with automatic quality upgrades.
115
+
116
+ ### 🚀 Quick Start (Recommended)
117
+
118
+ ```bash
119
+ # One command installation - works on all systems
120
+ pip install abstractvoice[all]
121
+
122
+ # Verify it works
123
+ python -c "from abstractvoice import VoiceManager; print('✅ Ready to go!')"
124
+ ```
68
125
 
69
- - Python 3.8+ (3.11+ recommended)
70
- - PortAudio for audio input/output
71
- - **Recommended**: espeak-ng for best voice quality (VITS model)
126
+ **That's it!** AbstractVoice automatically:
127
+ - **Works everywhere** - Uses reliable models that run on any system
128
+ - **Auto-upgrades quality** - Detects when better models are available
129
+ - ✅ **No system dependencies required** - Pure Python installation
130
+ - ✅ **Optional quality boost** - Install `espeak-ng` for premium voices
72
131
 
73
- ### Basic Installation
132
+ ### Installation Options
74
133
 
75
134
  ```bash
76
- # Install from PyPI
135
+ # Minimal (just 2 dependencies)
77
136
  pip install abstractvoice
78
137
 
79
- # Or clone the repository
80
- git clone https://github.com/lpalbou/abstractvoice.git
81
- cd abstractvoice
82
- pip install -e .
138
+ # Add features as needed
139
+ pip install abstractvoice[tts] # Text-to-speech
140
+ pip install abstractvoice[stt] # Speech-to-text
141
+ pip install abstractvoice[all] # Everything (recommended)
142
+
143
+ # Language-specific
144
+ pip install abstractvoice[fr] # French with all features
145
+ pip install abstractvoice[de] # German with all features
83
146
  ```
84
147
 
85
- ### Development Installation
148
+ ### Optional Quality Upgrade
149
+
150
+ For the **absolute best voice quality**, install espeak-ng:
86
151
 
87
152
  ```bash
88
- # Install with development dependencies
89
- pip install "abstractvoice[dev]"
153
+ # macOS
154
+ brew install espeak-ng
155
+
156
+ # Linux
157
+ sudo apt-get install espeak-ng
158
+
159
+ # Windows
160
+ conda install espeak-ng
90
161
  ```
91
162
 
92
- ### From Requirements File
163
+ AbstractVoice automatically detects espeak-ng and upgrades to premium quality voices when available.
93
164
 
94
- ```bash
95
- # Install all dependencies including the package
96
- pip install -r requirements.txt
165
+ ## Quick Start
166
+
167
+ ### Basic Usage (Minimal Installation)
168
+
169
+ ```python
170
+ # First install with minimal dependencies
171
+ # pip install abstractvoice
172
+
173
+ from abstractvoice import VoiceManager
174
+
175
+ # This will show a helpful error message with installation instructions
176
+ try:
177
+ vm = VoiceManager()
178
+ except ImportError as e:
179
+ print(e) # Shows: "TTS functionality requires optional dependencies..."
180
+ # Follow the instructions to install: pip install abstractvoice[all]
97
181
  ```
98
182
 
99
- ### Installing espeak-ng (Recommended for Best Quality)
183
+ ### Full Usage Example
100
184
 
101
- AbstractVoice will work without espeak-ng, but voice quality will be significantly better with it:
185
+ ```python
186
+ # After installing with: pip install abstractvoice[all]
102
187
 
103
- **macOS:**
104
- ```bash
105
- brew install espeak-ng
188
+ from abstractvoice import VoiceManager
189
+
190
+ # Initialize voice manager
191
+ vm = VoiceManager(language='en', debug_mode=True)
192
+
193
+ # Text-to-speech
194
+ vm.speak("Hello! I can speak text and listen for responses.")
195
+
196
+ # Speech-to-text with callbacks
197
+ def on_transcription(text):
198
+ print(f"You said: {text}")
199
+ # Process the transcription
200
+ vm.speak(f"I heard you say: {text}")
201
+
202
+ def on_stop():
203
+ print("Stopping voice interaction")
204
+
205
+ # Start listening
206
+ vm.listen(on_transcription, on_stop)
207
+
208
+ # The voice manager will automatically pause listening when speaking
209
+ # and resume when done to prevent feedback loops
106
210
  ```
107
211
 
108
- **Linux (Ubuntu/Debian):**
109
- ```bash
110
- sudo apt-get install espeak-ng
212
+ ## Additional Examples
213
+
214
+ ### Language-Specific Usage
215
+
216
+ ```python
217
+ # French voice
218
+ vm_fr = VoiceManager(language='fr')
219
+ vm_fr.speak("Bonjour! Je peux parler français.")
220
+
221
+ # Spanish voice
222
+ vm_es = VoiceManager(language='es')
223
+ vm_es.speak("¡Hola! Puedo hablar español.")
224
+
225
+ # Dynamic language switching
226
+ vm.set_language('fr') # Switch to French
227
+ vm.set_language('en') # Switch back to English
111
228
  ```
112
229
 
113
- **Linux (Fedora/RHEL):**
114
- ```bash
115
- sudo yum install espeak-ng
230
+ ### Advanced Configuration
231
+
232
+ ```python
233
+ from abstractvoice import VoiceManager
234
+
235
+ # Custom TTS model selection
236
+ vm = VoiceManager(
237
+ language='en',
238
+ tts_model='tts_models/en/ljspeech/fast_pitch', # Specific model
239
+ whisper_model='base', # Larger Whisper model for better accuracy
240
+ debug_mode=True
241
+ )
242
+
243
+ # Speed control
244
+ vm.set_speed(1.5) # 1.5x speed
245
+ vm.speak("This text will be spoken faster.")
246
+
247
+ # Model switching at runtime
248
+ vm.set_tts_model('tts_models/en/ljspeech/vits') # Switch to VITS
249
+ vm.set_whisper('small') # Switch to larger Whisper model
116
250
  ```
117
251
 
118
- **Windows:**
119
- ```bash
120
- # Option 1: Using Conda
121
- conda install -c conda-forge espeak-ng
252
+ ### Error Handling and Graceful Degradation
122
253
 
123
- # Option 2: Using Chocolatey
124
- choco install espeak-ng
254
+ AbstractVoice is designed to provide helpful error messages and fallback gracefully:
255
+
256
+ ```python
257
+ # If you install just the basic package
258
+ # pip install abstractvoice
125
259
 
126
- # Option 3: Download installer from https://github.com/espeak-ng/espeak-ng/releases
260
+ from abstractvoice import VoiceManager # This works fine
261
+
262
+ try:
263
+ vm = VoiceManager() # This will fail with helpful message
264
+ except ImportError as e:
265
+ print(e)
266
+ # Output: "TTS functionality requires optional dependencies. Install with:
267
+ # pip install abstractvoice[tts] # For TTS only
268
+ # pip install abstractvoice[all] # For all features"
269
+
270
+ # Missing espeak-ng automatically falls back to compatible models
271
+ # Missing dependencies show clear installation instructions
272
+ # All errors are graceful with helpful guidance
127
273
  ```
128
274
 
129
- **Without espeak-ng:** AbstractVoice will automatically fall back to a simpler TTS model (fast_pitch) that works everywhere but has lower voice quality.
275
+ ## CLI and Web Examples
130
276
 
131
- ## Quick Start
277
+ AbstractVoice includes example applications to demonstrate its capabilities:
132
278
 
133
279
  ### Using AbstractVoice from the Command Line
134
280
 
@@ -0,0 +1,21 @@
1
+ abstractvoice/__init__.py,sha256=6GWG6ruCOQ73dOK1-lGB4F8fvjoAtsAP8fIoYCnVuZk,817
2
+ abstractvoice/__main__.py,sha256=e6jhoONg3uwwPUCdnr68bSRTT1RrpWy2DrOJ6ozMJVc,4775
3
+ abstractvoice/dependency_check.py,sha256=BUUADz4un4_FCZzNpgwk1qpJ6yqVi5Pvjfd3JLS8hAI,10045
4
+ abstractvoice/recognition.py,sha256=4KtDUDFixEYuBUMDH2fWaD9csKlwA9tqXkMAkyQMSMo,11259
5
+ abstractvoice/voice_manager.py,sha256=WYuN949pzf4pw8SE3g40OQZNC1CbgUZ5SzvpAGAIfPI,29995
6
+ abstractvoice/examples/__init__.py,sha256=94vpKJDlfOrEBIUETg-57Q5Z7fYDidg6v4UzV7V_lZA,60
7
+ abstractvoice/examples/cli_repl.py,sha256=uRFqUOVDP6RXrMquB_rQ1_fxdyLn_UHwuiu30XHbYwE,41250
8
+ abstractvoice/examples/voice_cli.py,sha256=mhiO7i0AooPWPZD-K6O-wQUvMFbRFED-dlGNUjDvsUE,3962
9
+ abstractvoice/examples/web_api.py,sha256=0g5LKJpl7fZepPQJL25AcdaevV-xv34VqqyWGYYchPk,6376
10
+ abstractvoice/stt/__init__.py,sha256=PFc6la3tTkxT4TJYwb0PnMIahM_hFtU4pNQdeKmbooo,120
11
+ abstractvoice/stt/transcriber.py,sha256=GdaH1OsCHu4Vu9rUsQlzH6X9bfcnoiK5tGz1AW_uj6Q,5481
12
+ abstractvoice/tts/__init__.py,sha256=WgJrxqdc_qaRyfFt1jbgMQD9S757jYuBpDzMRB02TFs,122
13
+ abstractvoice/tts/tts_engine.py,sha256=9CZAZITZ_VNZs0grwsqWIFj3aUsHvrWeFVV66lH_Bf8,44926
14
+ abstractvoice/vad/__init__.py,sha256=RIIbFw25jNHgel06E4VvTWJnXjwjeFZ98m1Vx9hVjuo,119
15
+ abstractvoice/vad/voice_detector.py,sha256=ghrhpDFlIR5TsMB2gpigXY6t5c_1yZ7vEX1imAMgWjc,3166
16
+ abstractvoice-0.2.1.dist-info/licenses/LICENSE,sha256=TiDPM5WcFRQPoC5e46jGMeMppZ-eu0eFx_HytjE49bk,1105
17
+ abstractvoice-0.2.1.dist-info/METADATA,sha256=KFp786KB4_KECTUvlTdWgvLkiTPXhrHhJup9huRAESs,37533
18
+ abstractvoice-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ abstractvoice-0.2.1.dist-info/entry_points.txt,sha256=rL63lqtLrbd7w_hGsR_w9Mr5baq4p3Mzwn4_UJqR_nI,120
20
+ abstractvoice-0.2.1.dist-info/top_level.txt,sha256=a1qyxqgF1O8cJtPKpcJuImGZ_uXqPNghbLZ9gp-UiOo,14
21
+ abstractvoice-0.2.1.dist-info/RECORD,,
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Laurent-Philippe Albou (lpalbou@gmail.com)
3
+ Copyright (c) 2025 Laurent-Philippe Albou (contact@abstractcore.ai)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,20 +0,0 @@
1
- abstractvoice/__init__.py,sha256=6GWG6ruCOQ73dOK1-lGB4F8fvjoAtsAP8fIoYCnVuZk,817
2
- abstractvoice/__main__.py,sha256=ZACGwnSWpqyjQ4oDj6IMj0hV8w76UCST5ZVZa8NMdNY,3546
3
- abstractvoice/recognition.py,sha256=dWAZ-Pxk0GrDurfTEuDRd5f5DjRYq_68qffUMyr0IvY,9487
4
- abstractvoice/voice_manager.py,sha256=fDDWAXY6K8wv51JFdLfEDR5-1TW8gevFNY7czyMx4FA,9049
5
- abstractvoice/examples/__init__.py,sha256=94vpKJDlfOrEBIUETg-57Q5Z7fYDidg6v4UzV7V_lZA,60
6
- abstractvoice/examples/cli_repl.py,sha256=_Pvp6dSkdJz8csQ3YvVAyAOuI3t0GYdp6_2L3uftC4A,33363
7
- abstractvoice/examples/voice_cli.py,sha256=M3Gf7CN3XJJkIcILfj5141SAMVCCie7yjG_fwHjbiDA,3141
8
- abstractvoice/examples/web_api.py,sha256=0g5LKJpl7fZepPQJL25AcdaevV-xv34VqqyWGYYchPk,6376
9
- abstractvoice/stt/__init__.py,sha256=PFc6la3tTkxT4TJYwb0PnMIahM_hFtU4pNQdeKmbooo,120
10
- abstractvoice/stt/transcriber.py,sha256=DhCT3yXdWr0dsD7ciT2tIa6XAHrIe3ZvuwK8S7pUM2Y,4845
11
- abstractvoice/tts/__init__.py,sha256=WgJrxqdc_qaRyfFt1jbgMQD9S757jYuBpDzMRB02TFs,122
12
- abstractvoice/tts/tts_engine.py,sha256=cuoKaMw7MP2PyUFE0LwZZqYI8tcIGIiX2ZzSP1QH4qo,39224
13
- abstractvoice/vad/__init__.py,sha256=RIIbFw25jNHgel06E4VvTWJnXjwjeFZ98m1Vx9hVjuo,119
14
- abstractvoice/vad/voice_detector.py,sha256=fR7uNuDVx_0vLzcMa8d1cEYtyAeZ1nW9ao5_V57rW7s,2584
15
- abstractvoice-0.1.1.dist-info/licenses/LICENSE,sha256=jxyvKKcODBeM8o4aaTjVpeSI74XSjS4zwIu_n-8eNNE,1099
16
- abstractvoice-0.1.1.dist-info/METADATA,sha256=DJFMbqivew2GBq6uc4sFrEhjBTaIIBKq0lxlKOmFITo,31804
17
- abstractvoice-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- abstractvoice-0.1.1.dist-info/entry_points.txt,sha256=rL63lqtLrbd7w_hGsR_w9Mr5baq4p3Mzwn4_UJqR_nI,120
19
- abstractvoice-0.1.1.dist-info/top_level.txt,sha256=a1qyxqgF1O8cJtPKpcJuImGZ_uXqPNghbLZ9gp-UiOo,14
20
- abstractvoice-0.1.1.dist-info/RECORD,,