Пример #1
0
 def google_voice(cls, text, tl="en", encoding="UTF-8"):
     url = "http://translate.google.cn/translate_tts"
     text = text.encode("utf-8", "ignore")
     data = dict(ie=encoding,
                 tl=tl,
                 total=1,
                 idx=0,
                 textlen=len(text),
                 prev="input",
                 q=text)
     args = encode_params(data)
     return "%s?%s" % (url, args)
Пример #2
0
def google_voice(text, tl="en", encoding="UTF-8"):
    url = "http://translate.google.cn/translate_tts"
    text = text.encode("utf-8", "ignore")
    data = dict(ie=encoding,
                tl=tl,
                total=1,
                idx=0,
                textlen=len(text),
                prev="input",
                q=text
                )
    args = encode_params(data)
    return "%s?%s" % (url, args)
Пример #3
0
 def get_voice(self, text, lang):
     url = "http://dict.youdao.com/dictvoice"
     data = {
         "keyfrom": "deskdict.mini.word",
         "audio": text,
         "client": "deskdict",
         "id": "cee84504d9984f1b2",
         "vendor": "unknown",
         "in": "YoudaoDict",
         "appVer": "5.4.46.5554",
         "appZengqiang": 0,
         "type": lang
     }
     return "%s?%s" % (url, encode_params(data))
Пример #4
0
 def get_voice(self, text, lang):
     url = "http://dict.youdao.com/dictvoice"
     data = { "keyfrom" : "deskdict.mini.word", "audio" : text, "client" : "deskdict", "id" : "cee84504d9984f1b2", "vendor": "unknown", 
              "in" : "YoudaoDict", "appVer" : "5.4.46.5554", "appZengqiang" : 0, "type" : lang}
     return "%s?%s" % (url, encode_params(data))