This article was originally posted on WomenLearnThai.com.
Your computer can speak Thai… even if you don’t…
Those learning Thai struggle. No doubt. There’s a ton of free audio available for Chinese, French, Italian, German, yadda yadda. But not so much for learning Thai. Many students of Thai have resorted to recording their own materials.
Recording Thai vocabulary and phrases is fairly easy for those who live in Thailand. What I do is set up my SnowBall, grab a generous Thai friend, and have fun. But when birds started screaming at all hours and then jackhammers joined in, recording Thai for posts (even with a portable soundbox) became difficult to pull off.
Then along came Bernard Le Du’s post, SI, SI, VOTRE MAC PARLE THAÏ ! So YES! YES! my Mac CAN speak Thai! And by that, I mean it can read Thai out loud.
There are several ways to get your computer to speak Thai by reading from Thai script. And each have their own quirks. On the Mac, Lion and Mountain Lion have Thai capabilities. For the PC, other than using Chrome, I don’t know what’s available. If you do let us know in the comments (and if you want to write a post on the subject, please contact me).
Note: For the sample audio I’m using a phrase from Hugh’s, Thai Language Thai Culture: Pain and Suffering: ปวดไหม /bpùat măi/ (does that hurt?)
Lion and Mountain Lion…
Following Bernard’s instructions, to get my Mac to speak Thai I first had to upgrade my computer. When I eventually got around to it – my life has been insane lately – the process was almost painless.
Download Narisa >> System Prefs >> Dictation Speech >> Text to Speech >> Narisa. I say ‘almost’ painless because Apple muffed up the download (but Bernard came to my rescue – thanks Bernard 🙂
To hear audio: Select Thai text >> right click >> choose ‘Speak Thai’ from contextual menu.
To record audio: Select Thai text >> right click >> choose ‘Add to iTunes as Spoken Track’ from contextual menu >> select Narisa >> Continue (mp4 format).
In his post Bernard also mentioned a sound spelling checker. That’ll come in handy as I’m cacca at spelling in any language.
Mac App: Voice…
In the Mac App store there’s a free app called Voice (the graphic is shown in the banner above). Voice also uses Narisa.
To hear audio: Open the app >> paste the text into the window >> select the text >> click ‘play’.
To record audio: Instead of clicking ‘play’, click ‘record’ to export a sound file (aiff format).
NOTE: The Chrome extensions don’t record (that I could find) so from here on in I’ve used Audacity. The results are not as clear as the originals but fiddling didn’t give an exact sound either so I left them as is. Comparing the audio files direct from my computer, Luke’s Speak Thai and Google Translate have a sweeter sound.
Awhile back Luke Hubbard @lukeinTH (programmer at codegent.com) came out with a handy Chrome extension, Speak Thai. When I enquired he was happy to share.
Is very simple from a tech point of view. Its a little extension that sends the selected text the text to speech server used by Google translate. This then speaks it out in Thai using the html5 audio api. The source code is available to anyone who fancies having a look.
I wrote it the other day while stuck in traffic to scratch a little itch. Like many farang living here I can understand quite a bit of spoken Thai but I’ve never actually learned to read the script (call me lazy). I have Google translate plugin in my browser and that can translate the whole page but it doesn’t do a good job on conversational Thai (the sort of thing in social media feeds). Worse it seems to rewrite English into Pigeon English leaving me with broken Thai and broken English :). Up until now I’ve been copying small bits of text over to Google translate and translating them there to get some context. Really what I wanted was a way to speak out the text since I can usually understand it if I hear it.
In the past I’ve done this in OSX using the excellent Narisa voice plus some accessibility shortcut to read the selected text. While thats is one solution it does involve a rather big download (900mb if I remember correctly) and I didn’t have it installed on this computer. Since Google has a similar capability I thought I might as well make an extension to make better use of it.
Speak Thai: Select Thai text >> right click >> choose ‘Speak Thai’ from contextual menu. Reads short bits of text (perfect for twitter).
Chrome Speak: Select Thai text >> right click >> choose ‘Read the selected text’ from contextual menu. Reads long bits of text.
SpeakIt!: Select Thai text >> right click >> choose ‘SpeakIt!’ from contextual menu.
Google Translate will speak Thai for you, but not Thai and English combined (it defaults to English).
Rendering text-to-speech files…
Christopher from MacWorld has an interesting Mac tutorial for automating TextExit files to audio, Rendering text-to-speech files. Problem is, I can’t get it to work (doesn’t allow ‘Show This Action When the Workflow Runs’). If you can get your head around it please let me know!
14 thoughts on “Does Your Computer Speak Thai?”
Xmas brought a new Mac and I found a different way to bring up the contextual menu – two finger click on the trackpad. Kanya, the Thai voice, seems better too.
Thanks Bernard. So it’s an unintentional sound spell checker – works for me 🙂
Sorry my post is full of little typing mistakes, and I cannot find any way to edit it to correct the spelling. For example, of course, I was writing about น้ำ (not น้ำท).
“In his post Bernard also mentioned a sound spelling checker. That’ll come in handy as I’m cacca at spelling in any language.”
I guess you misunderstood me. What I wanted to say here, is that when you write thai incorrectly, the thai voice cannot recognize the word, and so cannot pronounce it, but start to “spell” it. So immediately you know that there a problem with the word and can go to see that that could be.
The most usual problem is how to enter with keyboard the upper vowels and tone marks like นั่ง
I just noticed from my practice on Mac that you can sometime enter the vowel first then the tone mark but some other time you should enter first the tone mark then the vowel. What is sure is that for the use of ำ like in น้ำท you always enter the tone mark BEFORE the vowel.
In the other cases with other vowels and tone marks, it is not clear. You have to learn each case and remember how to type !
And so each time the voice system of OS X do not recognize the word because you do not enter vowel and tone mark in the order it was waiting for, the word in’t pronounce but spell aloud !
Hope that will clarify a bit what I meant in the French article I wrote.
You are welcome Chris 🙂
I love that my computer can do this! I’m so much better at remembering a language if I can hear it, as well as read it. I’m so happy there’s an extension for Chrome for this! Thanks so much!
There’s one resource that speaks Thai and English quite well. If I have the time I’ll poke around to see which one it is.
I think the Thai voice might do a better job with Thai than the English voice does with English on my computer … not perfect as you say; I think the biggest problem is that it doesn’t pause in the places a Thai speaker would. Then again, neither do I.
I decided that my own “Speak Text” Service wasn’t so redundant after all; I set the default voice back to one of the ones for English, so now the built-in Speak Text speaks English and my custom Service speaks Thai.
Hah! I know what you mean. I was showing it to a Thai friend last week. When she finally understood what was going on she was amazed. There are of course some iffy bits in pronunciation, but over all it’s good.
It is pretty exciting! Or depressing, because my computer now reads Thai better than I do. 🙂
Hi Keith, thanks for explaining how to create a Service! Bernard sent an email explaining but I haven’t had time to go through the process yet. This is exciting stuff, yes? I can’t wait to start creating audio files (I have oodles of materials to work with).
Oops. Looks like the Speak Text feature is already available for selected text once you install the Narisa voice.
Forgot to mention this, but just in case: you can run a Service by selecting the text and choosing the Service from the application’s menu (e.g., Mail, Word, Safari etc.) or by selecting the text and right-clicking to get the contextual menu.
Looks like Google Chrome doesn’t support OSX Services, but it sounds like the extension you mention works similarly.
This is pretty cool. I tried it and initially encountered an error whenever I dragged a file onto the app I created in Automator. Looks like the document must be already open in TextEdit for the drag and drop to work.
However, I tried saving the Workflow as a Service instead of an Application. Since you have to select the text yourself in order for the new text to speech file Service to appear in the Services menu, I left out the Get Contents of TextEdit Document step, leaving only the Text to Audio File action.
The “show this action when the workflow runs” was available in the “Text to Audio File” action and lets you choose a file name, otherwise you get a file named “audio text.aiff” automatically.
The best thing about Services is they are available in many applications: I was able to create sound files from selected text in Microsoft Word and Apple Mail as well as TextEdit. I also created a second Service to read selected text using the same approach but with the “Speak Text” action instead.
Another nice thing is that you can edit your Service by choosing Service Preferences in the Service menu and right clicking on the Service and choosing Open in Automator.
Thanks for finding this!