sonify1026 0.1.0__tar.gz
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.
- sonify1026-0.1.0/LICENSE +21 -0
- sonify1026-0.1.0/MANIFEST.in +7 -0
- sonify1026-0.1.0/PKG-INFO +198 -0
- sonify1026-0.1.0/README.md +159 -0
- sonify1026-0.1.0/pyproject.toml +80 -0
- sonify1026-0.1.0/requirements.txt +5 -0
- sonify1026-0.1.0/setup.cfg +4 -0
- sonify1026-0.1.0/snfy/__init__.py +38 -0
- sonify1026-0.1.0/snfy/__main__.py +39 -0
- sonify1026-0.1.0/snfy/engine.py +2098 -0
- sonify1026-0.1.0/snfy/voice_config.yaml +441 -0
- sonify1026-0.1.0/sonify1026.egg-info/PKG-INFO +198 -0
- sonify1026-0.1.0/sonify1026.egg-info/SOURCES.txt +18 -0
- sonify1026-0.1.0/sonify1026.egg-info/dependency_links.txt +1 -0
- sonify1026-0.1.0/sonify1026.egg-info/entry_points.txt +3 -0
- sonify1026-0.1.0/sonify1026.egg-info/requires.txt +11 -0
- sonify1026-0.1.0/sonify1026.egg-info/top_level.txt +1 -0
- sonify1026-0.1.0/tests/metrics.py +253 -0
- sonify1026-0.1.0/tests/test_quality.py +549 -0
- sonify1026-0.1.0/tests/voice_audit.py +369 -0
sonify1026-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BIOS-02
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sonify1026
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Expressive Indian female TTS voice engine with adaptive emotion, prosody and EN/HI code-switching
|
|
5
|
+
Author-email: Naitik <sanjeevshrivastava898@gmail.com>
|
|
6
|
+
Maintainer-email: Naitik <sanjeevshrivastava898@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/naitik0409/sonify1026
|
|
9
|
+
Project-URL: Source, https://github.com/naitik0409/sonify1026
|
|
10
|
+
Project-URL: Issues, https://github.com/naitik0409/sonify1026/issues
|
|
11
|
+
Keywords: tts,text-to-speech,voice,speech,synthesis,hindi,hinglish,indian-english,emotion,prosody,edge-tts,text2speech
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Natural Language :: English
|
|
24
|
+
Classifier: Natural Language :: Hindi
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: edge-tts>=6.1.12
|
|
29
|
+
Requires-Dist: numpy>=1.26.0
|
|
30
|
+
Requires-Dist: scipy>=1.11.0
|
|
31
|
+
Requires-Dist: soundfile>=0.12.1
|
|
32
|
+
Requires-Dist: PyYAML>=6.0.1
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
37
|
+
Requires-Dist: sounddevice>=0.4.6; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
# Sonify 1026 Voice Engine
|
|
41
|
+
|
|
42
|
+
[](https://pypi.org/project/sonify1026/)
|
|
43
|
+
[](https://pypi.org/project/sonify1026/)
|
|
44
|
+
[](LICENSE)
|
|
45
|
+
|
|
46
|
+
An expressive, adaptive **Indian female TTS voice engine** — mid-20s, urban Indian
|
|
47
|
+
English with native-standard Hindi code-switching.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install sonify1026
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
import snfy
|
|
55
|
+
|
|
56
|
+
engine = snfy.SonifyEngine()
|
|
57
|
+
engine.synthesize(
|
|
58
|
+
"That is wonderful news, I am so happy for you!",
|
|
59
|
+
emotion=snfy.Emotion.HAPPY,
|
|
60
|
+
output_path="out.wav",
|
|
61
|
+
)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
> Installed as **`sonify1026`**, imported as **`snfy`** — the same pattern as
|
|
65
|
+
> `pip install beautifulsoup4` / `import bs4`.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Voice profile
|
|
70
|
+
|
|
71
|
+
| Aspect | Behaviour |
|
|
72
|
+
|---|---|
|
|
73
|
+
| Timbre | Warm, mid register with low-to-mid chest resonance; light, mid-high pitch |
|
|
74
|
+
| Delivery | Spontaneous and extemporaneous — no metronomic line-reading |
|
|
75
|
+
| Expressiveness | Emotional valence analysed per sentence: smiling inflection on positive phrases, acoustic softening on tender ones, subglottic lift on emphatic ones |
|
|
76
|
+
| Pacing | Non-linear — pauses, rate and breathing scale with the emotional subtext |
|
|
77
|
+
| Imperfections | Soft breath intakes, mouth clicks, micro-pauses, occasional vocal fry |
|
|
78
|
+
| Clarity | Phase-preserving EQ, no compression, no time-stretching in the output path |
|
|
79
|
+
| Uniqueness | Every call is its own performance (no fixed seed) |
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Features
|
|
84
|
+
|
|
85
|
+
- **Bilingual** — English (`en-IN-NeerjaNeural`) and Hindi (`hi-IN-SwaraNeural`), with automatic Hinglish code-switching in either direction.
|
|
86
|
+
- **17 emotions** — `neutral`, `happy`, `calm`, `warm`, `gentle`, `sad`, `excited`, `angry`, `fearful`, `thoughtful`, `playful`, `tired`, `proud`, `surprised`, `reassuring`, `serious`, `whisper`.
|
|
87
|
+
- **Adaptive prosody** — intensity words, sentence length and emotional valence drive pitch, rate, volume, brightness, warmth, breathing interval and pause length per sentence.
|
|
88
|
+
- **Emotional arc** — a script that builds in feeling sounds like it builds, instead of resetting each sentence.
|
|
89
|
+
- **Register control** — `normal`, `formal`, `casual` (casual is the default).
|
|
90
|
+
- **Number normalisation** — digits, decimals, times, ordinals and phone numbers are spoken naturally (both ASCII and Devanagari).
|
|
91
|
+
- **Pitch guard** — verifies the rendered voice sits in the intended register and re-renders if a phrase drifts too low or high.
|
|
92
|
+
- **Offline fallback** — pyttsx3 when the network is unavailable.
|
|
93
|
+
- **Fully configurable** — every voice parameter lives in one YAML file; nothing is hardcoded.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Installation
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pip install sonify1026
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Requires Python 3.9+. An internet connection is required at synthesis time
|
|
104
|
+
(audio is served by Microsoft Edge TTS); no API key needed.
|
|
105
|
+
|
|
106
|
+
## Usage
|
|
107
|
+
|
|
108
|
+
### Python API
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
import snfy
|
|
112
|
+
|
|
113
|
+
engine = snfy.SonifyEngine()
|
|
114
|
+
|
|
115
|
+
# English
|
|
116
|
+
engine.synthesize("Hello! How are you today?", emotion=snfy.Emotion.WARM,
|
|
117
|
+
output_path="en.wav")
|
|
118
|
+
|
|
119
|
+
# Hindi
|
|
120
|
+
engine.synthesize("नमस्ते! आपका दिन शुभ हो।", emotion=snfy.Emotion.WARM,
|
|
121
|
+
language=snfy.Language.HI_IN, output_path="hi.wav")
|
|
122
|
+
|
|
123
|
+
# Hinglish — detected automatically
|
|
124
|
+
engine.synthesize("Yaar, kal ki meeting bahut important hai, on time aa jaana.",
|
|
125
|
+
output_path="hinglish.wav")
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Work with audio in memory:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
import soundfile as sf
|
|
132
|
+
|
|
133
|
+
result = engine.synthesize("Hello!") # no output_path
|
|
134
|
+
sf.write("out.wav", result.audio, result.sample_rate)
|
|
135
|
+
print(result.duration, result.sample_rate) # 4.91 48000
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Runtime controls
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
engine.set_speed(1.15) # 0.5 - 2.0
|
|
142
|
+
engine.set_pitch(0) # -20 - +25 Hz
|
|
143
|
+
engine.set_volume(1.0) # 0.0 - 1.5
|
|
144
|
+
engine.set_offline_mode(True) # pyttsx3 fallback
|
|
145
|
+
engine.reload_config() # re-read voice_config.yaml
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### CLI
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
sonify1026 "Hello! How are you?" --emotion warm --output hello.wav
|
|
152
|
+
sonify1026 "यह एक परीक्षण है।" -e calm -o test.wav
|
|
153
|
+
sonify1026 "Play this." --play
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Configuration
|
|
159
|
+
|
|
160
|
+
All voice behaviour lives in `snfy/voice_config.yaml`. Use your own file with:
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
engine = SonifyEngine(config_path="my_voice.yaml")
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
| Key | Effect |
|
|
167
|
+
|---|---|
|
|
168
|
+
| `character.base_pitch` | overall register (Hz offset) |
|
|
169
|
+
| `pitch_guard` | auto-corrects register if a phrase drifts |
|
|
170
|
+
| `persona.warm_hz` / `warm_gain` | chest resonance |
|
|
171
|
+
| `persona.presence_gain` | high-frequency clarity |
|
|
172
|
+
| `voice_settings.<voice>.eq` | per-voice tone shaping |
|
|
173
|
+
| `emotions.<name>` | per-emotion rate / volume / pause / compression |
|
|
174
|
+
| `dynamic_prosody.valence_words` | what counts as positive / tender / negative |
|
|
175
|
+
| `breath` | breath intakes before phrases |
|
|
176
|
+
| `humanize.max_utterance_chars` | where takes are split |
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Testing
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
pytest tests -q # 56 objective quality/regression checks
|
|
184
|
+
python tests/voice_audit.py # full voice QA report across a corpus
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Clarity, loudness and modulation are measured objectively from the rendered
|
|
188
|
+
waveform and judged relative to the same text rendered straight through
|
|
189
|
+
edge-tts, so regressions in clarity or naturalness are caught automatically.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
MIT — see [LICENSE](LICENSE).
|
|
196
|
+
|
|
197
|
+
Audio is generated by Microsoft Edge TTS; you are responsible for complying with
|
|
198
|
+
its terms of use.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Sonify 1026 Voice Engine
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/sonify1026/)
|
|
4
|
+
[](https://pypi.org/project/sonify1026/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
An expressive, adaptive **Indian female TTS voice engine** — mid-20s, urban Indian
|
|
8
|
+
English with native-standard Hindi code-switching.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install sonify1026
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
import snfy
|
|
16
|
+
|
|
17
|
+
engine = snfy.SonifyEngine()
|
|
18
|
+
engine.synthesize(
|
|
19
|
+
"That is wonderful news, I am so happy for you!",
|
|
20
|
+
emotion=snfy.Emotion.HAPPY,
|
|
21
|
+
output_path="out.wav",
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
> Installed as **`sonify1026`**, imported as **`snfy`** — the same pattern as
|
|
26
|
+
> `pip install beautifulsoup4` / `import bs4`.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Voice profile
|
|
31
|
+
|
|
32
|
+
| Aspect | Behaviour |
|
|
33
|
+
|---|---|
|
|
34
|
+
| Timbre | Warm, mid register with low-to-mid chest resonance; light, mid-high pitch |
|
|
35
|
+
| Delivery | Spontaneous and extemporaneous — no metronomic line-reading |
|
|
36
|
+
| Expressiveness | Emotional valence analysed per sentence: smiling inflection on positive phrases, acoustic softening on tender ones, subglottic lift on emphatic ones |
|
|
37
|
+
| Pacing | Non-linear — pauses, rate and breathing scale with the emotional subtext |
|
|
38
|
+
| Imperfections | Soft breath intakes, mouth clicks, micro-pauses, occasional vocal fry |
|
|
39
|
+
| Clarity | Phase-preserving EQ, no compression, no time-stretching in the output path |
|
|
40
|
+
| Uniqueness | Every call is its own performance (no fixed seed) |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- **Bilingual** — English (`en-IN-NeerjaNeural`) and Hindi (`hi-IN-SwaraNeural`), with automatic Hinglish code-switching in either direction.
|
|
47
|
+
- **17 emotions** — `neutral`, `happy`, `calm`, `warm`, `gentle`, `sad`, `excited`, `angry`, `fearful`, `thoughtful`, `playful`, `tired`, `proud`, `surprised`, `reassuring`, `serious`, `whisper`.
|
|
48
|
+
- **Adaptive prosody** — intensity words, sentence length and emotional valence drive pitch, rate, volume, brightness, warmth, breathing interval and pause length per sentence.
|
|
49
|
+
- **Emotional arc** — a script that builds in feeling sounds like it builds, instead of resetting each sentence.
|
|
50
|
+
- **Register control** — `normal`, `formal`, `casual` (casual is the default).
|
|
51
|
+
- **Number normalisation** — digits, decimals, times, ordinals and phone numbers are spoken naturally (both ASCII and Devanagari).
|
|
52
|
+
- **Pitch guard** — verifies the rendered voice sits in the intended register and re-renders if a phrase drifts too low or high.
|
|
53
|
+
- **Offline fallback** — pyttsx3 when the network is unavailable.
|
|
54
|
+
- **Fully configurable** — every voice parameter lives in one YAML file; nothing is hardcoded.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install sonify1026
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Requires Python 3.9+. An internet connection is required at synthesis time
|
|
65
|
+
(audio is served by Microsoft Edge TTS); no API key needed.
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
### Python API
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
import snfy
|
|
73
|
+
|
|
74
|
+
engine = snfy.SonifyEngine()
|
|
75
|
+
|
|
76
|
+
# English
|
|
77
|
+
engine.synthesize("Hello! How are you today?", emotion=snfy.Emotion.WARM,
|
|
78
|
+
output_path="en.wav")
|
|
79
|
+
|
|
80
|
+
# Hindi
|
|
81
|
+
engine.synthesize("नमस्ते! आपका दिन शुभ हो।", emotion=snfy.Emotion.WARM,
|
|
82
|
+
language=snfy.Language.HI_IN, output_path="hi.wav")
|
|
83
|
+
|
|
84
|
+
# Hinglish — detected automatically
|
|
85
|
+
engine.synthesize("Yaar, kal ki meeting bahut important hai, on time aa jaana.",
|
|
86
|
+
output_path="hinglish.wav")
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Work with audio in memory:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import soundfile as sf
|
|
93
|
+
|
|
94
|
+
result = engine.synthesize("Hello!") # no output_path
|
|
95
|
+
sf.write("out.wav", result.audio, result.sample_rate)
|
|
96
|
+
print(result.duration, result.sample_rate) # 4.91 48000
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Runtime controls
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
engine.set_speed(1.15) # 0.5 - 2.0
|
|
103
|
+
engine.set_pitch(0) # -20 - +25 Hz
|
|
104
|
+
engine.set_volume(1.0) # 0.0 - 1.5
|
|
105
|
+
engine.set_offline_mode(True) # pyttsx3 fallback
|
|
106
|
+
engine.reload_config() # re-read voice_config.yaml
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### CLI
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
sonify1026 "Hello! How are you?" --emotion warm --output hello.wav
|
|
113
|
+
sonify1026 "यह एक परीक्षण है।" -e calm -o test.wav
|
|
114
|
+
sonify1026 "Play this." --play
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
All voice behaviour lives in `snfy/voice_config.yaml`. Use your own file with:
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
engine = SonifyEngine(config_path="my_voice.yaml")
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
| Key | Effect |
|
|
128
|
+
|---|---|
|
|
129
|
+
| `character.base_pitch` | overall register (Hz offset) |
|
|
130
|
+
| `pitch_guard` | auto-corrects register if a phrase drifts |
|
|
131
|
+
| `persona.warm_hz` / `warm_gain` | chest resonance |
|
|
132
|
+
| `persona.presence_gain` | high-frequency clarity |
|
|
133
|
+
| `voice_settings.<voice>.eq` | per-voice tone shaping |
|
|
134
|
+
| `emotions.<name>` | per-emotion rate / volume / pause / compression |
|
|
135
|
+
| `dynamic_prosody.valence_words` | what counts as positive / tender / negative |
|
|
136
|
+
| `breath` | breath intakes before phrases |
|
|
137
|
+
| `humanize.max_utterance_chars` | where takes are split |
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Testing
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
pytest tests -q # 56 objective quality/regression checks
|
|
145
|
+
python tests/voice_audit.py # full voice QA report across a corpus
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Clarity, loudness and modulation are measured objectively from the rendered
|
|
149
|
+
waveform and judged relative to the same text rendered straight through
|
|
150
|
+
edge-tts, so regressions in clarity or naturalness are caught automatically.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
MIT — see [LICENSE](LICENSE).
|
|
157
|
+
|
|
158
|
+
Audio is generated by Microsoft Edge TTS; you are responsible for complying with
|
|
159
|
+
its terms of use.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0.3", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sonify1026"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Expressive Indian female TTS voice engine with adaptive emotion, prosody and EN/HI code-switching"
|
|
9
|
+
readme = {file = "README.md", content-type = "text/markdown"}
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [
|
|
14
|
+
{name = "Naitik", email = "sanjeevshrivastava898@gmail.com"},
|
|
15
|
+
]
|
|
16
|
+
maintainers = [
|
|
17
|
+
{name = "Naitik", email = "sanjeevshrivastava898@gmail.com"},
|
|
18
|
+
]
|
|
19
|
+
keywords = [
|
|
20
|
+
"tts",
|
|
21
|
+
"text-to-speech",
|
|
22
|
+
"voice",
|
|
23
|
+
"speech",
|
|
24
|
+
"synthesis",
|
|
25
|
+
"hindi",
|
|
26
|
+
"hinglish",
|
|
27
|
+
"indian-english",
|
|
28
|
+
"emotion",
|
|
29
|
+
"prosody",
|
|
30
|
+
"edge-tts",
|
|
31
|
+
"text2speech",
|
|
32
|
+
]
|
|
33
|
+
classifiers = [
|
|
34
|
+
"Development Status :: 4 - Beta",
|
|
35
|
+
"Intended Audience :: Developers",
|
|
36
|
+
"Operating System :: OS Independent",
|
|
37
|
+
"Programming Language :: Python :: 3",
|
|
38
|
+
"Programming Language :: Python :: 3.9",
|
|
39
|
+
"Programming Language :: Python :: 3.10",
|
|
40
|
+
"Programming Language :: Python :: 3.11",
|
|
41
|
+
"Programming Language :: Python :: 3.12",
|
|
42
|
+
"Programming Language :: Python :: 3.13",
|
|
43
|
+
"Topic :: Multimedia :: Sound/Audio :: Speech",
|
|
44
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
45
|
+
"Natural Language :: English",
|
|
46
|
+
"Natural Language :: Hindi",
|
|
47
|
+
]
|
|
48
|
+
dependencies = [
|
|
49
|
+
"edge-tts>=6.1.12",
|
|
50
|
+
"numpy>=1.26.0",
|
|
51
|
+
"scipy>=1.11.0",
|
|
52
|
+
"soundfile>=0.12.1",
|
|
53
|
+
"PyYAML>=6.0.1",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[project.optional-dependencies]
|
|
57
|
+
dev = [
|
|
58
|
+
"pytest>=7.0.0",
|
|
59
|
+
"build>=1.0.0",
|
|
60
|
+
"twine>=4.0.0",
|
|
61
|
+
"sounddevice>=0.4.6",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[project.urls]
|
|
65
|
+
Homepage = "https://github.com/naitik0409/sonify1026"
|
|
66
|
+
Source = "https://github.com/naitik0409/sonify1026"
|
|
67
|
+
Issues = "https://github.com/naitik0409/sonify1026/issues"
|
|
68
|
+
|
|
69
|
+
[project.scripts]
|
|
70
|
+
sonify1026 = "snfy.__main__:main"
|
|
71
|
+
snfy = "snfy.__main__:main"
|
|
72
|
+
|
|
73
|
+
[tool.setuptools.packages.find]
|
|
74
|
+
include = ["snfy*"]
|
|
75
|
+
|
|
76
|
+
[tool.setuptools.package-data]
|
|
77
|
+
snfy = ["*.yaml", "*.yml"]
|
|
78
|
+
|
|
79
|
+
[tool.pytest.ini_options]
|
|
80
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Sonify 1026 Voice Engine
|
|
3
|
+
An expressive, adaptive Indian female TTS engine with emotion, accent,
|
|
4
|
+
prosody and EN/HI code-switching control.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .engine import (
|
|
8
|
+
SonifyEngine,
|
|
9
|
+
BIOS02VoiceEngine,
|
|
10
|
+
Emotion,
|
|
11
|
+
Language,
|
|
12
|
+
Persona,
|
|
13
|
+
ProsodyParams,
|
|
14
|
+
SynthesisResult,
|
|
15
|
+
create_engine,
|
|
16
|
+
render,
|
|
17
|
+
render_arc,
|
|
18
|
+
speak,
|
|
19
|
+
REGISTERS,
|
|
20
|
+
DEFAULT_REGISTER,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
__version__ = "0.1.0"
|
|
24
|
+
__all__ = [
|
|
25
|
+
"SonifyEngine",
|
|
26
|
+
"BIOS02VoiceEngine",
|
|
27
|
+
"Emotion",
|
|
28
|
+
"Language",
|
|
29
|
+
"Persona",
|
|
30
|
+
"ProsodyParams",
|
|
31
|
+
"SynthesisResult",
|
|
32
|
+
"create_engine",
|
|
33
|
+
"render",
|
|
34
|
+
"render_arc",
|
|
35
|
+
"speak",
|
|
36
|
+
"REGISTERS",
|
|
37
|
+
"DEFAULT_REGISTER",
|
|
38
|
+
]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Sonify 1026 CLI - Run as: snfy "Hello world", or python -m snfy "Hello world"
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import sys
|
|
7
|
+
from .engine import SonifyEngine, Emotion
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main():
|
|
11
|
+
parser = argparse.ArgumentParser(description="Sonify 1026 Voice Engine CLI")
|
|
12
|
+
parser.add_argument("text", help="Text to synthesize")
|
|
13
|
+
parser.add_argument("--emotion", "-e", default="neutral", help="Emotion preset")
|
|
14
|
+
parser.add_argument("--accent", "-a", default="in", choices=["in", "us"], help="Accent")
|
|
15
|
+
parser.add_argument("--output", "-o", default="output.wav", help="Output file path")
|
|
16
|
+
parser.add_argument("--play", "-p", action="store_true", help="Play audio after synthesis")
|
|
17
|
+
args = parser.parse_args()
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
emotion = Emotion(args.emotion.lower())
|
|
21
|
+
except ValueError:
|
|
22
|
+
print(f"Unknown emotion: {args.emotion}. Using neutral.")
|
|
23
|
+
emotion = Emotion.NEUTRAL
|
|
24
|
+
|
|
25
|
+
engine = SonifyEngine()
|
|
26
|
+
result = engine.synthesize(args.text, emotion=emotion, accent=args.accent, output_path=args.output)
|
|
27
|
+
print(f"Saved to {args.output} ({result.duration:.2f}s)")
|
|
28
|
+
|
|
29
|
+
if args.play:
|
|
30
|
+
try:
|
|
31
|
+
import sounddevice as sd
|
|
32
|
+
sd.play(result.audio, result.sample_rate)
|
|
33
|
+
sd.wait()
|
|
34
|
+
except ImportError:
|
|
35
|
+
print("Install sounddevice to play audio: pip install sounddevice")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
if __name__ == "__main__":
|
|
39
|
+
main()
|