c# - Get MP3 from Google Translate special letters -
i using code:
using system.net; function() { using (webclient client = new webclient()) { client.downloadfile("http://translate.google.com/translate_tts?tl=en&q=hello", "a.mp3"); } }
its working fine. notice please english language language downloading. main problem comes when i'd same language using non-latin letter, illustration thai:
using system.net; function() { using (webclient client = new webclient()) { client.downloadfile("http://translate.google.com/translate_tts?tl=th&q=สวัสดี", "a.mp3"); } }
but giving me such nonsence mp3 without word sound. how prepare please?
notice main construction of website:
...translate.google.com/translate_tts?tl=**en**&q=**hello**"
...translate.google.com/translate_tts?tl=**th**&q=**สวัสดี**"
use httputility.urlpathencode("สวัสดี")
encode unicode characters.
c# download mp3 translate letter
No comments:
Post a Comment