let ctrl-c work
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
import signal
|
||||||
import argparse
|
import argparse
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import websocket # pip install websocket-client
|
import websocket # pip install websocket-client
|
||||||
@@ -16,6 +17,11 @@ trustedClientToken = '6A5AA1D4EAFF4E9FB37E23D68491D6F4'
|
|||||||
voiceList = 'https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list?trustedclienttoken=' + trustedClientToken
|
voiceList = 'https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list?trustedclienttoken=' + trustedClientToken
|
||||||
wsUrl = 'wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=' + trustedClientToken
|
wsUrl = 'wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=' + trustedClientToken
|
||||||
|
|
||||||
|
def terminator(signo, stack_frame):
|
||||||
|
sys.exit()
|
||||||
|
signal.signal(signal.SIGINT, terminator)
|
||||||
|
signal.signal(signal.SIGTERM, terminator)
|
||||||
|
|
||||||
def connectId():
|
def connectId():
|
||||||
return str(uuid.uuid4()).replace("-", "")
|
return str(uuid.uuid4()).replace("-", "")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user