jdlorimer / chinese-support-redux

Anki add-on providing support for Chinese study
https://ankiweb.net/shared/info/1128979221
GNU General Public License v3.0
101 stars 50 forks source link

Add support for Baidu AI TTS #62

Open smartens opened 5 years ago

smartens commented 5 years ago

I would like to suggest implementing an additional TTS service option.

It's now possible to download the speech synthesis from https://ai.baidu.com/tech/speech/tts. In my opinion it's the best you can get for free.

A mp3 file is obtainable with a simple request e.g. http://ai.baidu.com/aidemo?type=tns&spd=5&pit=5&vol=5&per=1&tex=%E6%AC%A2%E8%BF%8E%E4%BD%BF%E7%94%A8%E7%99%BE%E5%BA%A6AI%E5%BC%80%E6%94%BE%E5%B9%B3%E5%8F%B0&dt=1 (this is the example sentence).

With this solution it would be also possible to give the user the ability to configure the desired speech output with the four parameters spd, pit, vol and per(speaker).

jdlorimer commented 5 years ago

I've drafted this, so it should be available in the next release, provided the URL actually works. At the moment I'm getting an error from your link: {"errno":102,"msg":"请求Demo过于频繁","data":""}

jdlorimer commented 5 years ago

I don't even know how I'd go about rate-limiting this, since I've only requested the demo twice and it's already complaining.

smartens commented 5 years ago

Okay I'm getting the same error response when I didn't visit the website before. So they also have a check if you visited the website or not. But as soon as I visited the website I can download it as many times I want. I guess they have a time interval for the user.

So to get that thing to work there is a request against the website needed from time to time. But I can't really say anything about rate-limiting because it works for me as soon I visit the website.

Not really a great solution but it would be awesome to get this working because the speech synthesis is really great and the possibility to make it a bit slower really helps me to practice my pronunciation.

jdlorimer commented 5 years ago

I'll see what I can do. No promises.

On Tue, 16 Apr 2019 at 18:05, Steffen Martens notifications@github.com wrote:

Okay I'm getting the same error response when I didn't visit the website before. So they also have a check if you visited the website or not. But as soon as I visited the website I can download it as many times I want. I guess they have a time interval for the user.

So to get that thing to work there is a request against the website needed from time to time. But I can't really say anything about rate-limiting because it works for me as soon I visit the website.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/luoliyan/chinese-support-redux/issues/62#issuecomment-483565724, or mute the thread https://github.com/notifications/unsubscribe-auth/AX1JfL5-EzCq_MYAOXh_A86XaFKPQwS8ks5vhYtZgaJpZM4cvO03 .

smartens commented 4 years ago

Are there any updates regarding the implementation? Somehow it's not anymore available on the website but the request in my first post works flawlessly. It seems also that there is no rate limiting anymore.

Would be great if you would try it out again 🙂