Commit Graph

275 Commits

Author SHA1 Message Date
Rany
063957683c Improve type support a bit more (#333)
Also fix default voice for util.py

Signed-off-by: rany <rany2@riseup.net>
2024-11-23 19:59:39 +02:00
Rany
a3d468c7c9 Cleanup examples and fix VoicesManager types (#332)
Signed-off-by: rany <rany2@riseup.net>
2024-11-23 16:29:13 +02:00
Rany
17e5146606 Fix typo in SubMaker's feed() logic (#331)
The start time should be the offset and the end time is
offset + duration.

Signed-off-by: rany <rany2@riseup.net>
2024-11-23 13:30:16 +02:00
Rany
144215496a Cleanup subtitle related code and make it easier to use SubMaker (#329)
Also don't output subtitles to STDERR by default.

Signed-off-by: rany <rany2@riseup.net>
2024-11-22 22:57:54 +02:00
Rany
93fb851cd2 Define an upper-bound for all SemVer dependencies (#328)
Signed-off-by: rany <rany2@riseup.net>
2024-11-22 22:06:16 +02:00
Rany
d0e201ad3e Change default voice to en-US-EmmaMultilingualNeural (#327)
It sounds more natural than the default Aria voice to me
and should support more languages out of the box.

Signed-off-by: rany <rany2@riseup.net>
2024-11-22 21:55:07 +02:00
Rany
4611d79101 Use the short name for the default voice (#326)
Switch to en-US-AriaNeural for the default voice name. It will
be converted automatically to the complete voice name anyway.

Signed-off-by: rany <rany2@riseup.net>
2024-11-22 21:35:26 +02:00
Rany
d619925df2 Add support for custom aiohttp connector (#325)
This should allow users that need it to add support for SOCKS5
in their application via https://pypi.org/project/aiohttp-socks/.

Partially fixes: https://github.com/rany2/edge-tts/issues/147

Signed-off-by: rany <rany2@riseup.net>
2024-11-22 21:31:45 +02:00
Rany
7ee40fff2c Fix difference in command request from Edge (#324)
"sentenceBoundaryEnabled" and "wordBoundaryEnabled" is sent as a
string by Microsoft Edge but we are sending it as a boolean.

As there is no difference in functionality (both boolean and string
are treated properly), we try to pretend we are Microsoft Edge as
much as possible.

Signed-off-by: rany <rany2@riseup.net>
2024-11-22 21:06:27 +02:00
Rany
4f5d79ed57 Drop words_in_cue code for SubMaker and switch to SRT (#323)
WebVTT isn't a very common format in the first place
and attempting to make WordBoundary play nice with
input text is very hard.

Instead we now just display the word that the TTS
is saying at a given time. In the future, we could
try to enable SentenceBoundary but there is a risk
that it will be banned by Microsoft as it is not used
by Microsoft Edge itself.

Closes: https://github.com/rany2/edge-tts/issues/118
Closes: https://github.com/rany2/edge-tts/issues/171
Closes: https://github.com/rany2/edge-tts/issues/229
Closes: https://github.com/rany2/edge-tts/issues/234

Signed-off-by: rany <rany2@riseup.net>
2024-11-22 20:58:47 +02:00
Rany
5a2674cd03 Update README (#322)
Signed-off-by: rany <rany2@riseup.net>
2024-11-22 20:29:26 +02:00
Rany
3f2b635ff6 Use tabulate to pretty print voices (#321)
Signed-off-by: rany <rany2@riseup.net>
2024-11-22 20:07:15 +02:00
Rany
3e4de19344 Use TypedDict for voice list and TTS stream (#320)
Signed-off-by: rany <rany2@riseup.net>
2024-11-22 20:04:52 +02:00
Rany
48c7f3ad2e Accept - as a valid input parameter (#319)
We won't do the same for the output parameter as it is the default
behavior when --write-media is not set.

Closes: https://github.com/rany2/edge-tts/issues/216

Signed-off-by: rany <rany2@riseup.net>
2024-11-22 18:37:44 +02:00
Rany
6bc3a9e20f Clean up code comments and docstrings (#318)
Signed-off-by: rany <rany2@riseup.net>
2024-11-22 18:28:43 +02:00
Rany
d10060fc60 Add GPLv3 license text (#317)
LGPLv3 requires that you also provide the GPLv3 license text as it supplements it.
2024-11-22 17:42:43 +02:00
Rany
e49da2cec5 Bump edge_tts version to 6.1.19 (#316)
Signed-off-by: rany <rany2@riseup.net>
2024-11-22 03:17:42 +02:00
Rany
40cd70c061 Relicense to GNU LGPLv3 (#314)
This should allow the library to be used without any
issues for non-GPLv3 projects.

Closes: https://github.com/rany2/edge-tts/issues/313

Approved-by: Hannes Krumbiegel <Vuizur@users.noreply.github.com>
Signed-off-by: rany <rany2@riseup.net>
2024-11-22 03:12:42 +02:00
Rany
7c83923a5b Bump edge_tts version to 6.1.18 (#310)
Signed-off-by: rany <rany2@riseup.net>
2024-11-11 13:04:56 +02:00
Rany
dc8ac2ea7a Add support for clock adjustment for Sec-MS-GEC token (#309)
This should help when a user might have his clock skewed by more than
5 minutes. The server allows for a bit more than ~5 minutes of skew.

Signed-off-by: rany <rany2@riseup.net>
2024-11-11 13:03:40 +02:00
Rany
16c973bec8 Fix CI (#308)
Signed-off-by: rany <rany2@riseup.net>
2024-11-09 10:46:23 +02:00
Rany
146b9d1bb5 Bump edge_tts version to 6.1.17 (#307)
Signed-off-by: rany <rany2@riseup.net>
2024-11-09 10:44:08 +02:00
Rany
bf6d897438 Fix Python <3.11 incompatibility bug (#306)
datetime.UTC is not supported on Python <3.11.

Signed-off-by: rany <rany2@riseup.net>
2024-11-09 10:42:21 +02:00
Rany
9652a900aa Bump edge_tts version to 6.1.16 (#304)
Signed-off-by: rany <rany2@riseup.net>
2024-11-08 18:36:50 +02:00
Rany
f014709c40 Add Sec-MS-GEC support (#303)
Credit to @gexgd0419 for understanding how the algorithm works.
See his comment here: https://github.com/rany2/edge-tts/issues/290#issuecomment-2464956570

Fixes: https://github.com/rany2/edge-tts/issues/302
Fixes: https://github.com/rany2/edge-tts/issues/299
Fixes: https://github.com/rany2/edge-tts/issues/295
Fixes: https://github.com/rany2/edge-tts/issues/290

Signed-off-by: rany <rany2@riseup.net>
Co-authored-by: gexgd0419 <55008943+gexgd0419@users.noreply.github.com>
2024-11-08 18:34:28 +02:00
Tharsis Souza
a98e9ac7d3 Add podcastfy example to README.md (#296)
Podcastfy is an Open Source Python alternative to NotebookLM's podcast feature that enables Transforming Multimodal Content into Captivating Multilingual Audio Conversations with GenAI

It uses Edge as one of the TTS backends.
2024-11-01 14:48:04 +02:00
Rany
0f4db8d78a Bump edge_tts version to 6.1.15 (#289)
Signed-off-by: rany <rany2@riseup.net>
2024-10-25 12:29:15 +03:00
Rany
b55a338fb4 Fix 403 error (#288)
* Fix typo in setting of User-Agent

I accidently added a $ probably because I was writing some
shell code at the same time. Oops....

Signed-off-by: rany <rany2@riseup.net>

* Update Chromium User-Agent version to 130

Signed-off-by: rany <rany2@riseup.net>

---------

Fixes: https://github.com/rany2/edge-tts/issues/286
Signed-off-by: rany <rany2@riseup.net>
2024-10-25 12:24:58 +03:00
Rany
3a21044e78 Bump edge_tts version to 6.1.14 (#273)
Signed-off-by: rany <rany2@riseup.net>
2024-10-19 10:06:06 +03:00
Rany
80fc1d0a61 Fix 403 error for list voices endpoint (#272)
Fixes #271

Signed-off-by: rany <rany2@riseup.net>
2024-10-19 10:05:08 +03:00
Rany
bd82487a8e Bump edge_tts version to 6.1.13 (#269)
Signed-off-by: rany <rany2@riseup.net>
2024-10-18 17:44:25 +03:00
BG5T
8e71135a22 Fix 403 Error (#268) 2024-10-18 17:42:26 +03:00
帕斯卡
209269ebf5 Use f-strings on constants for better readability (#260) 2024-10-09 11:19:00 +03:00
rany
dfd4cab849 Bump edge_tts version to 6.1.12
Signed-off-by: rany <rany2@riseup.net>
2024-05-23 00:50:55 +03:00
rany
f6a35fa8d9 Don't delete test outputs and only run cmp on srt
Signed-off-by: rany <rany2@riseup.net>
2024-05-21 17:05:32 +03:00
rany
580f880bda Fix #190
Signed-off-by: rany <rany2@riseup.net>
2024-05-21 16:36:52 +03:00
rany
98c9b59aa3 Add a test to check if #190 is resolved
Signed-off-by: rany <rany2@riseup.net>
2024-05-17 13:56:00 +03:00
rany
547d91dfd4 Fix aiohttp timeout issue
This addresses the issue described in https://github.com/rany2/edge-tts/issues/190#issuecomment-2116195342

Signed-off-by: rany <rany2@riseup.net>
2024-05-17 13:14:56 +03:00
rany2
6d9299a669 Silence sonarlint warning
Signed-off-by: rany2 <rany2@riseup.net>
2024-05-17 13:03:58 +03:00
Rany
388e6f2e98 [ReadMe] Link to examples directory directly 2024-04-25 13:32:59 +03:00
rany2
8d12741673 Fix minor typo in examples/sync_audio_stream_in_async_context.py
This typo does not cause any errors but it is better to fix it.

Signed-off-by: rany2 <rany2@riseup.net>
2024-04-21 18:09:54 +03:00
rany2
211e283d5b Bump edge_tts version to 6.1.11
Signed-off-by: rany2 <rany2@riseup.net>
2024-04-21 13:51:08 +03:00
lzieniew
6355b32f0c Add sync versions of stream and save methods (#215)
* Add sync versions of stream and save methods

In order to provide synchronous interface to the library

* Fix save_sync() failing to use metadata_fname and fix typing issues

Signed-off-by: rany <ranygh@riseup.net>

---------

Signed-off-by: rany <ranygh@riseup.net>
Co-authored-by: rany <ranygh@riseup.net>
2024-04-21 13:47:38 +03:00
Rany
bafe5d825a Merge pull request #210 from zhoukuncheng/refactor-async
Simplify asyncio main loop setup
2024-04-12 12:21:13 +03:00
Jack Cheng
e82a2d1d86 Simplify asyncio main loop setup 2024-04-08 09:57:20 +08:00
rany2
e58af9da76 Cleanup parse_metadata
Signed-off-by: rany2 <rany2@riseup.net>
2024-02-16 20:12:44 +02:00
rany2
ec91ec1944 Bump edge_tts version to 6.1.10
Signed-off-by: rany2 <rany2@riseup.net>
2024-02-16 20:06:50 +02:00
rany2
c9bf4247a8 Refactor communicate for better readability
Also improve performance on larger documents.

Signed-off-by: rany2 <rany2@riseup.net>
2024-02-16 19:56:18 +02:00
rany2
df6bac8b54 Fix pylint config and reformat
Signed-off-by: rany2 <rany2@riseup.net>
2024-02-16 18:05:02 +02:00
rany2
09956e3a20 Don't pin certifi version
Signed-off-by: rany2 <rany2@riseup.net>
2024-02-16 17:59:02 +02:00