Closed joyarzun closed 8 years ago
Thanks for the pull request! Great solution, that really fix the image search. Right now I'm on vacation, probably sometime next week I'll merge it. Thanks again.
You're welcome. In reality it is the same thing you did it. Thanks to you. For tts, I don't know how make it work. But not is important to me.
for tts, I am now using espeak:
def send_tts_portugues(self, message, match):
ttstext=match.group("text")
escapes = ''.join([chr(char) for char in range(1, 32)])
ttstext.translate(None, escapes)
id = hashlib.md5(ttstext.encode('utf-8')).hexdigest()
filetmp = ''.join(["/tmp/tts", id, str(int(time.time()))[:-2], ".wav"])
subprocess.call(["espeak", "-v", "pt+f5", "-s", "120", "-k", "-20", "-w", filetmp, "'"+ttstext+"'"])
self.video_sender.send_by_path(jid=message.getFrom(), path=filetmp)
Microsoft Azure Marketplace has a service that is free up to 5000 requests per month for voice/tts. But it does not support portuguese.
Yes, Microsoft supported portuguese. The project is moved to Project Oxford
Hi,
bing picture search is working well after getting a bing api key :)
Regards X23
Thanks, working great! Sorry for the delay to merge on master... Great PR...
Just to write it down somewhere...
Create an account on Microsoft and subscribe to the search service here (free for 5000 p/ month) https://datamarket.azure.com/dataset/bing/search
Get the API key here: https://datamarket.azure.com/account/keys
Update the config.py and success!
Maybe we can put Google Image again with: https://github.com/BirdAPI/Google-Search-API
Perhaps the image should be downloaded directly from Bing`s cache instead of from the original source. I have experienced many issues when connecting to the original server in order to download the image.
In addition, Bing`s cache provides optimized images, which are less demanding in regards to bandwidth, saving us a lot of server cost.
@andremacola At first glance, it should work with this API. Feel free to make a PR with the changes. @relima You are right. The original source is not always the best option. Can you make a PR with a parameter that you can switch from original to cached version?
@andremacola Done. https://github.com/joaoricardo000/whatsapp-bot-seed/pull/63
Google API image search is deprecated. This PR replace with Bing API