wyoming-microsoft-tts 1.3.3__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.
- tests/__init__.py +1 -0
- tests/conftest.py +26 -0
- tests/test_download.py +75 -0
- tests/test_microsoft_tts.py +17 -0
- tests/test_voice_parsing.py +169 -0
- wyoming_microsoft_tts/__init__.py +1 -0
- wyoming_microsoft_tts/__main__.py +208 -0
- wyoming_microsoft_tts/download.py +182 -0
- wyoming_microsoft_tts/handler.py +183 -0
- wyoming_microsoft_tts/microsoft_tts.py +62 -0
- wyoming_microsoft_tts/sentence_boundary.py +63 -0
- wyoming_microsoft_tts/version.py +3 -0
- wyoming_microsoft_tts/voices.json +12419 -0
- wyoming_microsoft_tts-1.3.3.dist-info/METADATA +92 -0
- wyoming_microsoft_tts-1.3.3.dist-info/RECORD +17 -0
- wyoming_microsoft_tts-1.3.3.dist-info/WHEEL +5 -0
- wyoming_microsoft_tts-1.3.3.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wyoming-microsoft-tts
|
|
3
|
+
Version: 1.3.3
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Home-page: https://github.com/hugobloem/wyoming-microsoft-tts
|
|
6
|
+
Author: Hugo Bloem
|
|
7
|
+
Author-email:
|
|
8
|
+
Requires-Python: >=3.13
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: azure-cognitiveservices-speech>=1.45.0
|
|
11
|
+
Requires-Dist: black>=25.1.0
|
|
12
|
+
Requires-Dist: lxml>=6.0.1
|
|
13
|
+
Requires-Dist: pycountry>=24.6.1
|
|
14
|
+
Requires-Dist: regex>=2025.7.34
|
|
15
|
+
Requires-Dist: wyoming>=1.7.2
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
|
|
19
|
+
# Wyoming Microsoft TTS
|
|
20
|
+
Wyoming protocol server for Microsoft Azure text-to-speech.
|
|
21
|
+
|
|
22
|
+
This Python package provides a Wyoming integration for Microsoft Azure text-to-speech and can be directly used with [Home Assistant](https://www.home-assistant.io/) voice and [Rhasspy](https://github.com/rhasspy/rhasspy3).
|
|
23
|
+
|
|
24
|
+
## Azure Speech Service
|
|
25
|
+
This program uses [Microsoft Azure Speech Service](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/). You can sign up to a free Azure account which comes with free tier of 500K characters per month, this should be enough for running a voice assistant as each command is relatively short. Plus, on Home Assistant the outputs are cached so each response will only be requested once. Once this amount is exceeded Azure could charge you for each second used (Current pricing is $0.36 per audio hour). I am not responsible for any incurred charges and recommend you set up a spending limit to reduce your exposure. However, for normal usage the free tier could suffice and the resource should not switch to a paid service automatically.
|
|
26
|
+
|
|
27
|
+
If you have not set up a speech resource, you can follow the instructions below. (you only need to do this once and works both for [Speech-to-Text](https://github.com/hugobloem/wyoming-microsoft-stt) and [Text-to-Speech](https://github.com/hugobloem/wyoming-microsoft-tts))
|
|
28
|
+
|
|
29
|
+
1. Sign in or create an account on [portal.azure.com](https://portal.azure.com).
|
|
30
|
+
2. Create a subscription by searching for `subscription` in the search bar. [Consult Microsoft Learn for more information](https://learn.microsoft.com/en-gb/azure/cost-management-billing/manage/create-subscription#create-a-subscription-in-the-azure-portal).
|
|
31
|
+
3. Create a speech resource by searching for `speech service`.
|
|
32
|
+
4. Select the subscription you created, pick or create a resource group, select a region, pick an identifiable name, and select the pricing tier (you probably want Free F0)
|
|
33
|
+
5. Once created, copy one of the keys from the speech service page. You will need this to run this program.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
Depending on your use case there are different installation options.
|
|
38
|
+
|
|
39
|
+
- **Using pip**
|
|
40
|
+
Clone the repository and install the package using pip. Please note the platform requirements as noted [here](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/quickstarts/setup-platform?tabs=linux%2Cubuntu%2Cdotnetcli%2Cdotnet%2Cjre%2Cmaven%2Cnodejs%2Cmac%2Cpypi&pivots=programming-language-python#platform-requirements).
|
|
41
|
+
```sh
|
|
42
|
+
pip install .
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- **Home Assistant Add-On**
|
|
46
|
+
Add the following repository as an add-on repository to your Home Assistant, or click the button below.
|
|
47
|
+
[https://github.com/hugobloem/homeassistant-addons](https://github.com/hugobloem/homeassistant-addons)
|
|
48
|
+
|
|
49
|
+
[](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fhugobloem%2Fhomeassistant-addons)
|
|
50
|
+
|
|
51
|
+
- **Docker container**
|
|
52
|
+
To run as a Docker container use the following command:
|
|
53
|
+
```bash
|
|
54
|
+
docker run ghcr.io/hugobloem/wyoming-microsoft-tts-noha:latest --<key> <value>
|
|
55
|
+
```
|
|
56
|
+
For the relevant keys please look at [the table below](#usage)
|
|
57
|
+
|
|
58
|
+
- **docker compose**
|
|
59
|
+
|
|
60
|
+
Below is a sample for a docker compose file. The azure region + subscription key can be set in environment variables. Everything else needs to be passed via command line arguments.
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
wyoming-proxy-azure-tts:
|
|
64
|
+
image: ghcr.io/hugobloem/wyoming-microsoft-tts-noha
|
|
65
|
+
container_name: wyoming-azure-tts
|
|
66
|
+
ports:
|
|
67
|
+
- "10200:10200"
|
|
68
|
+
environment:
|
|
69
|
+
AZURE_SERVICE_REGION: swedencentral
|
|
70
|
+
AZURE_SUBSCRIPTION_KEY: XXX
|
|
71
|
+
command: --voice=en-GB-SoniaNeural --uri=tcp://0.0.0.0:10200
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
Depending on the installation method parameters are parsed differently. However, the same options are used for each of the installation methods and can be found in the table below. Your service region and subscription key can be found on the speech service resource page (step 5 the Azure Speech service instructions).
|
|
76
|
+
|
|
77
|
+
For the bare-metal Python install the program is run as follows:
|
|
78
|
+
```python
|
|
79
|
+
python -m wyoming-microsoft-tts --<key> <value>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
| Key | Optional | Description |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| `service-region` | No | Azure service region e.g., `uksouth` |
|
|
85
|
+
| `subscription-key` | No | Azure subscription key |
|
|
86
|
+
| `uri` | No | Uri where the server will be broadcasted e.g., `tcp://0.0.0.0:10200` |
|
|
87
|
+
| `download-dir` | Yes | Directory to download voices.json into (default: /tmp/) |
|
|
88
|
+
| `voice` | Yes | Default voice to set for transcription, default: `en-GB-SoniaNeural` |
|
|
89
|
+
| `auto-punctuation` | Yes | Automatically add punctuation (default: `".?!"`) |
|
|
90
|
+
| `samples-per-chunk` | Yes | Number of samples per audio chunk (default: 1024) |
|
|
91
|
+
| `update-voices` | Yes | Download latest languages.json during startup |
|
|
92
|
+
| `debug` | Yes | Log debug messages |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
tests/__init__.py,sha256=ZEU8_ARBRGIqaAOTcPRsjXxcfHSojBm-5-krYBN-68g,13
|
|
2
|
+
tests/conftest.py,sha256=a_yG0zphFIa5ITijg-KTeyI4EJVC2vfKqIuHnsFFKFo,596
|
|
3
|
+
tests/test_download.py,sha256=HUyzGqKlDxUkJBTjUHDMNYvbUVfdx8QLjqhkJbd_UoQ,2689
|
|
4
|
+
tests/test_microsoft_tts.py,sha256=5Bfhj4b_gfcTe3UhKVVxLDVXasqyx1dVadFfbrtijuU,496
|
|
5
|
+
tests/test_voice_parsing.py,sha256=omJl9N6A4e8SGtDSY9QE5WlzeYBHoh2F2pQsw5sScKU,5877
|
|
6
|
+
wyoming_microsoft_tts/__init__.py,sha256=pjzj_kylPQkVCdCNrV8Po_ficSmwWCmK-JNVn7SEI3U,40
|
|
7
|
+
wyoming_microsoft_tts/__main__.py,sha256=ahsN8gUlN8qNmz_-fcR68CjFPkhoVzYaYzz_PQ4SXQo,6585
|
|
8
|
+
wyoming_microsoft_tts/download.py,sha256=gDelH36JU6nXLIwdkeSKLl2YbgdaPCNwWI87WZP2s4Y,6634
|
|
9
|
+
wyoming_microsoft_tts/handler.py,sha256=no4hzSccT6H9lQVzsDa6sCj6nBDeodsnbusFUJDIk04,6347
|
|
10
|
+
wyoming_microsoft_tts/microsoft_tts.py,sha256=dkTP_dLc6GSipzHptRS7NHX1IWwunFs_EZa29p_7-l4,2172
|
|
11
|
+
wyoming_microsoft_tts/sentence_boundary.py,sha256=zkQDjlpI0PIvdXyn-OA7sbxIQOcSRSZMt04R1Yyc6Ww,2102
|
|
12
|
+
wyoming_microsoft_tts/version.py,sha256=iG_JqR_Z5wfSTlMqH9H1vmrmlcgyFJdbRBRllY0yDgU,50
|
|
13
|
+
wyoming_microsoft_tts/voices.json,sha256=1msC7a0p7iUkNW31z_6o_PD8Ub_KD-of9ac7PqbT06M,291733
|
|
14
|
+
wyoming_microsoft_tts-1.3.3.dist-info/METADATA,sha256=D_oODTTlu08f3Gcw5pWHxB9J8ZAXBI2Igs0COH-AjSU,5544
|
|
15
|
+
wyoming_microsoft_tts-1.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
16
|
+
wyoming_microsoft_tts-1.3.3.dist-info/top_level.txt,sha256=Bz4WwowTNLkDogmWBnBXeOx0GgJGe2nLHX4h9HZRBf4,28
|
|
17
|
+
wyoming_microsoft_tts-1.3.3.dist-info/RECORD,,
|