Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In aliyun beijing region, edge-tts keeps connection timeout #239

Closed
xushijie opened this issue Aug 7, 2024 · 1 comment
Closed

In aliyun beijing region, edge-tts keeps connection timeout #239

xushijie opened this issue Aug 7, 2024 · 1 comment

Comments

@xushijie
Copy link

xushijie commented Aug 7, 2024

In aliyun, I received connection timeout every time.


2024-08-07 02:07:59 | INFO | "./app/services/voice.py:1042": azure_tts_v1 - start, voice name: zh-CN-YunxiNeural, try: 1
2024-08-07 02:08:10 | ERROR | "./app/services/voice.py:1063": azure_tts_v1 - failed, error: Connection timeout to host wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=5e4bfecfd487406b954c4f0903befdcf
2024-08-07 02:08:10 | INFO | "./app/services/voice.py:1042": azure_tts_v1 - start, voice name: zh-CN-YunxiNeural, try: 2
2024-08-07 02:08:21 | ERROR | "./app/services/voice.py:1063": azure_tts_v1 - failed, error: Connection timeout to host wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=cc701bfe0172422e9cf52cecb77bb267
2024-08-07 02:08:21 | INFO | "./app/services/voice.py:1042": azure_tts_v1 - start, voice name: zh-CN-YunxiNeural, try: 3
2024-08-07 02:08:32 | ERROR | "./app/services/voice.py:1063": azure_tts_v1 - failed, error: Connection timeout to host wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=a5e0e2749c574201a1381e0fa404fe6f

The code is like:


          logger.info(f"start, voice name: {voice_name}, try: {i + 1}")

            async def _do() -> SubMaker:
                communicate = edge_tts.Communicate(text, voice_name)
                sub_maker = edge_tts.SubMaker()
                with open(voice_file, "wb") as file:
                    async for chunk in communicate.stream():
                        if chunk["type"] == "audio":
                            file.write(chunk["data"])
                        elif chunk["type"] == "WordBoundary":
                            sub_maker.create_sub((chunk["offset"], chunk["duration"]), chunk["text"])
                return sub_maker

This code runs ok in my locally. So, what can do next for this issue? Tanks

The version here is: edge_tts~=6.1.10

@xushijie
Copy link
Author

xushijie commented Aug 8, 2024

This is aliyun issue

@xushijie xushijie closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant