Live data from Hacker News

gsay: Fetch pronunciation of English vocabulary from Google

github.com

1–10 of 13 posts

Re: gsay: Fetch pronunciation of English vocabulary from Google

#2
English is not my first language, and I didn't realize it was "google say" at first, so I was sitting here scratching my head wondering how you could possibly pronounce this word. Interesting that it's a shell script and not so much a browser extension or something. I guess this is for when you're knee deep in terminals?

Re: gsay: Fetch pronunciation of English vocabulary from Google

#3

English is not my first language, and I didn't realize it was "google say" at first, so I was sitting here scratching my head wondering how you could possibly pronounce this word. Interesting that it's a shell script and not so much a browser extension or something. I guess this is for when you're knee deep in terminals?

> I guess this is for when you're knee deep in terminals?

One can use it directly in terminal or it can be used as a dependency tool in other scripts similar to the way other UNIX tools are used. For example I use it as a pronunciation player in my dictionary dict-master [1]. It's a shell script too.

Another example (run two times so it uses the cache the second time):

  echo this unix pipeline is poor man text to speech | xargs -n 1 gsay
[1]: https://github.com/pvonmoradi/dict-master

Re: gsay: Fetch pronunciation of English vocabulary from Google

#4
I've made something (probably) very similar for quick GB vs US pronunciation check that also leeches on Google's snapshot of what I believe is a licensed copy of the Oxford collection the same way the shell script does, but mine "runs in browser's URL bar" instead. It's a super tiny dataURI HTML document, intended to be bookmarked with a keyword (say, "say"):

    data:text/html;charset=utf-8,US-GB pronunciation 2.0.2USGB
so when I do

    Alt+D, "say something", Enter
then hitting Tab plays it in British and Shift+Tab plays it in US English. It uses older 2016 batch, because I totally adore the US voice in it: just listen to "music" [1] and tell it isn't pure ASMR.

(I'm afraid it just a matter of time they will prevent our mischief, though.)

[0] oxfordlearnersdictionaries.com uses the same collection. [1] https://ssl.gstatic.com/dictionary/static/sounds/20160317/mu...

Re: gsay: Fetch pronunciation of English vocabulary from Google

#5
post #4

I've made something (probably) very similar for quick GB vs US pronunciation check that also leeches on Google's snapshot of what I believe is a licensed copy of the Oxford collection the same way the shell script does, but mine "runs in browser's URL bar" instead. It's a super tiny dataURI HTML document, intended to be bookmarked with a keyword (say, "say"): data:text/html;charset=utf-8, US-GB pronunciation 2.0.2 US…

Dubiously, I clicked. Yeah, I could listen to her read the dictionary as I waft off to sleep...

Re: gsay: Fetch pronunciation of English vocabulary from Google

#6
post #5
post #4

I've made something (probably) very similar for quick GB vs US pronunciation check that also leeches on Google's snapshot of what I believe is a licensed copy of the Oxford collection the same way the shell script does, but mine "runs in browser's URL bar" instead. It's a super tiny dataURI HTML document, intended to be bookmarked with a keyword (say, "say"): data:text/html;charset=utf-8, US-GB pronunciation 2.0.2 US…

Dubiously, I clicked. Yeah, I could listen to her read the dictionary as I waft off to sleep...

Ha ha, really glad to hear that. (The fact is, I am kinda freak/junkie about human voices, and that particular one stands really high on my list of irresistible tingles-inducing specimens. So happy to hear I am not alone.)

Re: gsay: Fetch pronunciation of English vocabulary from Google

#7
I tried running the suggested code (curl -sL ...) but inadvertently did not check it was missing quotes around '\r'. So after a while I started seeing some errors:

[error] No valid link found according to patterns for 'aboad'

[error] No valid link found according to patterns for 'absob'

[error] No valid link found according to patterns for 'acoss'

I thought "well, there's quite a lot of words I need to learn in English", but after seeing 'addess' and 'adventue' I thought "wait, this is not ight".

Fixing it helps, but there are still missing expressions, such as "add up", "a couple", etc.

Re: gsay: Fetch pronunciation of English vocabulary from Google

#8
post #6
post #5

Earlier quoted context omitted.

Dubiously, I clicked. Yeah, I could listen to her read the dictionary as I waft off to sleep...

Ha ha, really glad to hear that. (The fact is, I am kinda freak/junkie about human voices, and that particular one stands really high on my list of irresistible tingles-inducing specimens. So happy to hear I am not alone.)

Have you found any you like in the AI world for text to speech? I know ElevenLabs and OpenAI have voices, but I'm hoping to build something that can be run locally.

Re: gsay: Fetch pronunciation of English vocabulary from Google

#9
post #7

I tried running the suggested code (curl -sL ...) but inadvertently did not check it was missing quotes around '\r'. So after a while I started seeing some errors: [error] No valid link found according to patterns for 'aboad' [error] No valid link found according to patterns for 'absob' [error] No valid link found according to patterns for 'acoss' I thought "well, there's quite a lot of words I need to learn in Engli…

Thanks! Fixed that example. (In fish shell that I use, it didn't need those quotes that's why I didn't catch it)

>there are still missing expressions, such as "add up", "a couple", etc.

Googling "pronounce add up" does not show the google short answer box for me. Aside from that, the heuristic method I used may miss some words since it's not quite clear to me how the naming scheme works in that static stash. The 2024 stash is more straightforward but as I mentioned in readme, it sounds synthetic to me.

Post reply on HN