rany2 / edge-tts

Use Microsoft Edge's online text-to-speech service from Python WITHOUT needing Microsoft Edge or Windows or an API key
https://pypi.org/project/edge-tts/
GNU General Public License v3.0
4.24k stars 447 forks source link

Inconsistency between direct source execution and command line execution for Chinese subtitle generation #167

Closed sumanit closed 1 month ago

sumanit commented 6 months ago

When executing the subtitle generation logic directly from the source code, it correctly segments sentences based on punctuation, and there are no spaces between the characters, which is the expected behavior for Chinese text. However, when running the same logic via the command line interface, the sentence segmentation appears to be inaccurate, and there are unexpected spaces between Chinese characters.

input: 在忙碌和挑战中,我们的内心有时会感到疲惫。尤其是当我们发现自己脱发时,

sourceCode:

00:00:00,100 --> 00:00:01,538 在忙碌和挑战中

00:00:01,625 --> 00:00:04,237 我们的内心有时会感到疲惫

00:00:04,787 --> 00:00:07,225 尤其是当我们发现自己脱发时

command line: 00:00:00.100 --> 00:00:03.400 在 忙碌 和 挑战 中 我们 的 内心 有时 会

00:00:03.413 --> 00:00:07.875 感到 疲惫 尤其是 当 我们 发现 自己 脱发 时 心里

rany2 commented 2 months ago

Does this still happen?

rany2 commented 2 months ago

Nevermind I see what you mean now. It's the same issue as https://github.com/rany2/edge-tts/issues/156