abstractvoice 0.1.0__py3-none-any.whl → 0.2.0__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.0
3
+ Version: 0.2.0
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,108 @@ 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.27.0; extra == "tts"
29
+ Requires-Dist: torch>=2.0.0; extra == "tts"
30
+ Requires-Dist: torchaudio>=2.0.0; extra == "tts"
31
+ Requires-Dist: librosa>=0.10.0; extra == "tts"
32
+ Provides-Extra: stt
33
+ Requires-Dist: openai-whisper>=20230314; extra == "stt"
34
+ Requires-Dist: tiktoken>=0.6.0; extra == "stt"
35
+ Provides-Extra: web
36
+ Requires-Dist: flask>=2.0.0; extra == "web"
37
+ Provides-Extra: all
38
+ Requires-Dist: sounddevice>=0.4.6; extra == "all"
39
+ Requires-Dist: webrtcvad>=2.0.10; extra == "all"
40
+ Requires-Dist: PyAudio>=0.2.13; extra == "all"
41
+ Requires-Dist: openai-whisper>=20230314; extra == "all"
42
+ Requires-Dist: coqui-tts>=0.27.0; extra == "all"
43
+ Requires-Dist: torch>=2.0.0; extra == "all"
44
+ Requires-Dist: torchaudio>=2.0.0; extra == "all"
45
+ Requires-Dist: librosa>=0.10.0; extra == "all"
46
+ Requires-Dist: soundfile>=0.12.1; extra == "all"
47
+ Requires-Dist: flask>=2.0.0; extra == "all"
48
+ Requires-Dist: tiktoken>=0.6.0; extra == "all"
33
49
  Provides-Extra: dev
34
50
  Requires-Dist: pytest>=7.0.0; extra == "dev"
35
51
  Requires-Dist: black>=22.0.0; extra == "dev"
36
52
  Requires-Dist: flake8>=5.0.0; extra == "dev"
53
+ Provides-Extra: languages
54
+ Requires-Dist: sounddevice>=0.4.6; extra == "languages"
55
+ Requires-Dist: webrtcvad>=2.0.10; extra == "languages"
56
+ Requires-Dist: PyAudio>=0.2.13; extra == "languages"
57
+ Requires-Dist: openai-whisper>=20230314; extra == "languages"
58
+ Requires-Dist: coqui-tts>=0.27.0; extra == "languages"
59
+ Requires-Dist: torch>=2.0.0; extra == "languages"
60
+ Requires-Dist: torchaudio>=2.0.0; extra == "languages"
61
+ Requires-Dist: librosa>=0.10.0; extra == "languages"
62
+ Requires-Dist: soundfile>=0.12.1; extra == "languages"
63
+ Requires-Dist: flask>=2.0.0; extra == "languages"
64
+ Requires-Dist: tiktoken>=0.6.0; extra == "languages"
65
+ Provides-Extra: fr
66
+ Requires-Dist: sounddevice>=0.4.6; extra == "fr"
67
+ Requires-Dist: webrtcvad>=2.0.10; extra == "fr"
68
+ Requires-Dist: PyAudio>=0.2.13; extra == "fr"
69
+ Requires-Dist: openai-whisper>=20230314; extra == "fr"
70
+ Requires-Dist: coqui-tts>=0.27.0; extra == "fr"
71
+ Requires-Dist: torch>=2.0.0; extra == "fr"
72
+ Requires-Dist: torchaudio>=2.0.0; extra == "fr"
73
+ Requires-Dist: librosa>=0.10.0; extra == "fr"
74
+ Requires-Dist: soundfile>=0.12.1; extra == "fr"
75
+ Requires-Dist: flask>=2.0.0; extra == "fr"
76
+ Requires-Dist: tiktoken>=0.6.0; extra == "fr"
77
+ Provides-Extra: es
78
+ Requires-Dist: sounddevice>=0.4.6; extra == "es"
79
+ Requires-Dist: webrtcvad>=2.0.10; extra == "es"
80
+ Requires-Dist: PyAudio>=0.2.13; extra == "es"
81
+ Requires-Dist: openai-whisper>=20230314; extra == "es"
82
+ Requires-Dist: coqui-tts>=0.27.0; extra == "es"
83
+ Requires-Dist: torch>=2.0.0; extra == "es"
84
+ Requires-Dist: torchaudio>=2.0.0; extra == "es"
85
+ Requires-Dist: librosa>=0.10.0; extra == "es"
86
+ Requires-Dist: soundfile>=0.12.1; extra == "es"
87
+ Requires-Dist: flask>=2.0.0; extra == "es"
88
+ Requires-Dist: tiktoken>=0.6.0; extra == "es"
89
+ Provides-Extra: de
90
+ Requires-Dist: sounddevice>=0.4.6; extra == "de"
91
+ Requires-Dist: webrtcvad>=2.0.10; extra == "de"
92
+ Requires-Dist: PyAudio>=0.2.13; extra == "de"
93
+ Requires-Dist: openai-whisper>=20230314; extra == "de"
94
+ Requires-Dist: coqui-tts>=0.27.0; extra == "de"
95
+ Requires-Dist: torch>=2.0.0; extra == "de"
96
+ Requires-Dist: torchaudio>=2.0.0; extra == "de"
97
+ Requires-Dist: librosa>=0.10.0; extra == "de"
98
+ Requires-Dist: soundfile>=0.12.1; extra == "de"
99
+ Requires-Dist: flask>=2.0.0; extra == "de"
100
+ Requires-Dist: tiktoken>=0.6.0; extra == "de"
101
+ Provides-Extra: it
102
+ Requires-Dist: sounddevice>=0.4.6; extra == "it"
103
+ Requires-Dist: webrtcvad>=2.0.10; extra == "it"
104
+ Requires-Dist: PyAudio>=0.2.13; extra == "it"
105
+ Requires-Dist: openai-whisper>=20230314; extra == "it"
106
+ Requires-Dist: coqui-tts>=0.27.0; extra == "it"
107
+ Requires-Dist: torch>=2.0.0; extra == "it"
108
+ Requires-Dist: torchaudio>=2.0.0; extra == "it"
109
+ Requires-Dist: librosa>=0.10.0; extra == "it"
110
+ Requires-Dist: soundfile>=0.12.1; extra == "it"
111
+ Requires-Dist: flask>=2.0.0; extra == "it"
112
+ Requires-Dist: tiktoken>=0.6.0; extra == "it"
37
113
  Dynamic: license-file
38
114
 
39
115
  # AbstractVoice
40
116
 
41
117
  [![PyPI version](https://img.shields.io/pypi/v/abstractvoice.svg)](https://pypi.org/project/abstractvoice/)
42
118
  [![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)
119
+ [![license](https://img.shields.io/github/license/lpalbou/AbstractVoice)](https://github.com/lpalbou/abstractvoice/blob/main/LICENSE)
44
120
  [![GitHub stars](https://img.shields.io/github/stars/lpalbou/abstractvoice?style=social)](https://github.com/lpalbou/abstractvoice/stargazers)
45
121
 
122
+
46
123
  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
124
 
48
125
  While we provide CLI and WEB examples, AbstractVoice is designed to be integrated in other projects.
@@ -62,73 +139,174 @@ While we provide CLI and WEB examples, AbstractVoice is designed to be integrate
62
139
  - **Interrupt Handling**: Stop TTS by speaking or using stop commands
63
140
  - **Modular Design**: Easily integrate with any text generation system
64
141
 
142
+ 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)*.
143
+
65
144
  ## Installation
66
145
 
67
- ### Prerequisites
146
+ AbstractVoice is designed to **work everywhere, out of the box** with automatic quality upgrades.
147
+
148
+ ### 🚀 Quick Start (Recommended)
149
+
150
+ ```bash
151
+ # One command installation - works on all systems
152
+ pip install abstractvoice[all]
68
153
 
69
- - Python 3.8+ (3.11+ recommended)
70
- - PortAudio for audio input/output
71
- - **Recommended**: espeak-ng for best voice quality (VITS model)
154
+ # Verify it works
155
+ python -c "from abstractvoice import VoiceManager; print('✅ Ready to go!')"
156
+ ```
72
157
 
73
- ### Installing espeak-ng (Recommended for Best Quality)
158
+ **That's it!** AbstractVoice automatically:
159
+ - ✅ **Works everywhere** - Uses reliable models that run on any system
160
+ - ✅ **Auto-upgrades quality** - Detects when better models are available
161
+ - ✅ **No system dependencies required** - Pure Python installation
162
+ - ✅ **Optional quality boost** - Install `espeak-ng` for premium voices
74
163
 
75
- AbstractVoice will work without espeak-ng, but voice quality will be significantly better with it:
164
+ ### Installation Options
76
165
 
77
- **macOS:**
78
166
  ```bash
79
- brew install espeak-ng
167
+ # Minimal (just 2 dependencies)
168
+ pip install abstractvoice
169
+
170
+ # Add features as needed
171
+ pip install abstractvoice[tts] # Text-to-speech
172
+ pip install abstractvoice[stt] # Speech-to-text
173
+ pip install abstractvoice[all] # Everything (recommended)
174
+
175
+ # Language-specific
176
+ pip install abstractvoice[fr] # French with all features
177
+ pip install abstractvoice[de] # German with all features
80
178
  ```
81
179
 
82
- **Linux (Ubuntu/Debian):**
180
+ ### Optional Quality Upgrade
181
+
182
+ For the **absolute best voice quality**, install espeak-ng:
183
+
83
184
  ```bash
185
+ # macOS
186
+ brew install espeak-ng
187
+
188
+ # Linux
84
189
  sudo apt-get install espeak-ng
190
+
191
+ # Windows
192
+ conda install espeak-ng
85
193
  ```
86
194
 
87
- **Linux (Fedora/RHEL):**
88
- ```bash
89
- sudo yum install espeak-ng
195
+ AbstractVoice automatically detects espeak-ng and upgrades to premium quality voices when available.
196
+
197
+ ## Quick Start
198
+
199
+ ### Basic Usage (Minimal Installation)
200
+
201
+ ```python
202
+ # First install with minimal dependencies
203
+ # pip install abstractvoice
204
+
205
+ from abstractvoice import VoiceManager
206
+
207
+ # This will show a helpful error message with installation instructions
208
+ try:
209
+ vm = VoiceManager()
210
+ except ImportError as e:
211
+ print(e) # Shows: "TTS functionality requires optional dependencies..."
212
+ # Follow the instructions to install: pip install abstractvoice[all]
90
213
  ```
91
214
 
92
- **Windows:**
93
- ```bash
94
- # Option 1: Using Conda
95
- conda install -c conda-forge espeak-ng
215
+ ### Full Usage Example
96
216
 
97
- # Option 2: Using Chocolatey
98
- choco install espeak-ng
217
+ ```python
218
+ # After installing with: pip install abstractvoice[all]
99
219
 
100
- # Option 3: Download installer from https://github.com/espeak-ng/espeak-ng/releases
220
+ from abstractvoice import VoiceManager
221
+
222
+ # Initialize voice manager
223
+ vm = VoiceManager(language='en', debug_mode=True)
224
+
225
+ # Text-to-speech
226
+ vm.speak("Hello! I can speak text and listen for responses.")
227
+
228
+ # Speech-to-text with callbacks
229
+ def on_transcription(text):
230
+ print(f"You said: {text}")
231
+ # Process the transcription
232
+ vm.speak(f"I heard you say: {text}")
233
+
234
+ def on_stop():
235
+ print("Stopping voice interaction")
236
+
237
+ # Start listening
238
+ vm.listen(on_transcription, on_stop)
239
+
240
+ # The voice manager will automatically pause listening when speaking
241
+ # and resume when done to prevent feedback loops
101
242
  ```
102
243
 
103
- **Without espeak-ng:** AbstractVoice will automatically fall back to a simpler TTS model (fast_pitch) that works everywhere but has lower voice quality.
244
+ ## Additional Examples
104
245
 
105
- ### Basic Installation
246
+ ### Language-Specific Usage
106
247
 
107
- ```bash
108
- # Install from PyPI
109
- pip install abstractvoice
248
+ ```python
249
+ # French voice
250
+ vm_fr = VoiceManager(language='fr')
251
+ vm_fr.speak("Bonjour! Je peux parler français.")
110
252
 
111
- # Or clone the repository
112
- git clone https://github.com/lpalbou/abstractvoice.git
113
- cd abstractvoice
114
- pip install -e .
253
+ # Spanish voice
254
+ vm_es = VoiceManager(language='es')
255
+ vm_es.speak("¡Hola! Puedo hablar español.")
256
+
257
+ # Dynamic language switching
258
+ vm.set_language('fr') # Switch to French
259
+ vm.set_language('en') # Switch back to English
115
260
  ```
116
261
 
117
- ### Development Installation
262
+ ### Advanced Configuration
118
263
 
119
- ```bash
120
- # Install with development dependencies
121
- pip install "abstractvoice[dev]"
264
+ ```python
265
+ from abstractvoice import VoiceManager
266
+
267
+ # Custom TTS model selection
268
+ vm = VoiceManager(
269
+ language='en',
270
+ tts_model='tts_models/en/ljspeech/fast_pitch', # Specific model
271
+ whisper_model='base', # Larger Whisper model for better accuracy
272
+ debug_mode=True
273
+ )
274
+
275
+ # Speed control
276
+ vm.set_speed(1.5) # 1.5x speed
277
+ vm.speak("This text will be spoken faster.")
278
+
279
+ # Model switching at runtime
280
+ vm.set_tts_model('tts_models/en/ljspeech/vits') # Switch to VITS
281
+ vm.set_whisper('small') # Switch to larger Whisper model
122
282
  ```
123
283
 
124
- ### From Requirements File
284
+ ### Error Handling and Graceful Degradation
125
285
 
126
- ```bash
127
- # Install all dependencies including the package
128
- pip install -r requirements.txt
286
+ AbstractVoice is designed to provide helpful error messages and fallback gracefully:
287
+
288
+ ```python
289
+ # If you install just the basic package
290
+ # pip install abstractvoice
291
+
292
+ from abstractvoice import VoiceManager # This works fine
293
+
294
+ try:
295
+ vm = VoiceManager() # This will fail with helpful message
296
+ except ImportError as e:
297
+ print(e)
298
+ # Output: "TTS functionality requires optional dependencies. Install with:
299
+ # pip install abstractvoice[tts] # For TTS only
300
+ # pip install abstractvoice[all] # For all features"
301
+
302
+ # Missing espeak-ng automatically falls back to compatible models
303
+ # Missing dependencies show clear installation instructions
304
+ # All errors are graceful with helpful guidance
129
305
  ```
130
306
 
131
- ## Quick Start
307
+ ## CLI and Web Examples
308
+
309
+ AbstractVoice includes example applications to demonstrate its capabilities:
132
310
 
133
311
  ### Using AbstractVoice from the Command Line
134
312
 
@@ -0,0 +1,20 @@
1
+ abstractvoice/__init__.py,sha256=6GWG6ruCOQ73dOK1-lGB4F8fvjoAtsAP8fIoYCnVuZk,817
2
+ abstractvoice/__main__.py,sha256=RQCoQy-UrYp-f5K2cl6PTXpaJz3Rk0hSOvCWCf3Ql18,4230
3
+ abstractvoice/recognition.py,sha256=4KtDUDFixEYuBUMDH2fWaD9csKlwA9tqXkMAkyQMSMo,11259
4
+ abstractvoice/voice_manager.py,sha256=WYuN949pzf4pw8SE3g40OQZNC1CbgUZ5SzvpAGAIfPI,29995
5
+ abstractvoice/examples/__init__.py,sha256=94vpKJDlfOrEBIUETg-57Q5Z7fYDidg6v4UzV7V_lZA,60
6
+ abstractvoice/examples/cli_repl.py,sha256=uRFqUOVDP6RXrMquB_rQ1_fxdyLn_UHwuiu30XHbYwE,41250
7
+ abstractvoice/examples/voice_cli.py,sha256=mhiO7i0AooPWPZD-K6O-wQUvMFbRFED-dlGNUjDvsUE,3962
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=GdaH1OsCHu4Vu9rUsQlzH6X9bfcnoiK5tGz1AW_uj6Q,5481
11
+ abstractvoice/tts/__init__.py,sha256=WgJrxqdc_qaRyfFt1jbgMQD9S757jYuBpDzMRB02TFs,122
12
+ abstractvoice/tts/tts_engine.py,sha256=eMhOxMdqH7V29TLf-7B44aoafKfRDd3zT2lpSZkvAA0,41692
13
+ abstractvoice/vad/__init__.py,sha256=RIIbFw25jNHgel06E4VvTWJnXjwjeFZ98m1Vx9hVjuo,119
14
+ abstractvoice/vad/voice_detector.py,sha256=ghrhpDFlIR5TsMB2gpigXY6t5c_1yZ7vEX1imAMgWjc,3166
15
+ abstractvoice-0.2.0.dist-info/licenses/LICENSE,sha256=TiDPM5WcFRQPoC5e46jGMeMppZ-eu0eFx_HytjE49bk,1105
16
+ abstractvoice-0.2.0.dist-info/METADATA,sha256=uxKWbHnTylSvI0CFMq6IUjY6MUAjGIGPVf8o9KEjwqY,38738
17
+ abstractvoice-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
+ abstractvoice-0.2.0.dist-info/entry_points.txt,sha256=rL63lqtLrbd7w_hGsR_w9Mr5baq4p3Mzwn4_UJqR_nI,120
19
+ abstractvoice-0.2.0.dist-info/top_level.txt,sha256=a1qyxqgF1O8cJtPKpcJuImGZ_uXqPNghbLZ9gp-UiOo,14
20
+ abstractvoice-0.2.0.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.0.dist-info/licenses/LICENSE,sha256=jxyvKKcODBeM8o4aaTjVpeSI74XSjS4zwIu_n-8eNNE,1099
16
- abstractvoice-0.1.0.dist-info/METADATA,sha256=eV3ReI4fU5men2rofgFTT9_93ENqkOfCL0PdfNX1ouo,31804
17
- abstractvoice-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- abstractvoice-0.1.0.dist-info/entry_points.txt,sha256=rL63lqtLrbd7w_hGsR_w9Mr5baq4p3Mzwn4_UJqR_nI,120
19
- abstractvoice-0.1.0.dist-info/top_level.txt,sha256=a1qyxqgF1O8cJtPKpcJuImGZ_uXqPNghbLZ9gp-UiOo,14
20
- abstractvoice-0.1.0.dist-info/RECORD,,