I am trying to get XOJO to say some words in Greek. System.speak doesn’t seem to let me choose a language or voice. So I was looking to incorporate javascript. If I load this html file directly into Safari, it says the word for No in Greek.
However, if I load the file into an XOJO desktop.htmlviewer it SPELLS the word letter by letter rather than saying the word itself.
var html as string
html = speak1
Var f As FolderItem = FolderItem.TemporaryFile
HTMLViewer1.loadpage(html, f)
Any suggestions? I’m sure MBS could do it, but that is not a viable solution for this project. Frankly, I might just bypass XOJO entirely on this one if a solution is not close at hand.
Greek caught my attention
If you’re on Windows, take a look at this thread
There’s a code snippet there that allows you access to the Windows system languages.
Then your problem becomes installing a Greek language voice. They’re referred to as “Legacy Voices”
It seems that there is a male Greek voice (Stefanos) supported, but I wasn’t able to make use of it. Maybe it has to do with my edition of Windows and you’ll have better luck.
But accessing system voices via an OLE object no longer keeps you tied to whatever is behind System.Speak of the Xojo framework.
Good luck with it
-edit- just noticed that you’ve mentioned Safari, so you’re probably on a Mac
In a Mac you will need to use Declares. And the target machine must have a proper “voice” for the target locale. Here is a start point for your research:
re: Header, right you are although it has no change after correcting it.
The goal is just to have the program speak the text (single words and short phrases) I feed into it. I can make it work using javascript without using XOJO if I hard code the words/phrases into an array within an html file, but I really want to store and retrieve the words/phrases using a DB. Unfortunately, I don’t know how to get the words out of the DB using simple JS. I can do it if I also write some PHP scripts, but I was hoping to use XOJO just to make myself a better user interface. So I’ve looked into:
hard-coding into an html file using hard-coded js arrays/objects which currently works but is a pain to update and track my progress since I don’t know how to get html/js to work with a DB without PHP or XOJO
working with XOJO, mysql, and js, which does what I want except that it SPELLS the word in greek rather than just pronounce it.
work with mysql, html, js and php which I am pretty sure will work but is not satisfying and has too many files and processes to suit my taste for simplification.
Thanks very much for the code. It seems to work very well. I must say that having never worked with Declares I probably would never have been able to make it work on my own. So this is tremendous. Thanks again.
OT
Include Lib “SomeLibrary”
similar than in python for modules import matplotlib
or using ocx in vb6, there was somehow a method description with the library.
no need do declare all methods manually.
Import and include are usually used to bring in code that will be compiled/recompiled/cached/used.
It brings in “python code” with all declarations, you can even see the code that runs it. That’s why you don’t need to explain the call, that’s not a DLL or unix like shared lib.
Python is kind of harder than Xojo for such, that’s an extensive topic:
Those are COM/OLE objects, that’s another topic. Xojo have them covered. Once they are registered in a system, Xojo can access them.
For shared libs, Xojo uses kind of the same syntax VB6 had.
The binary lib does not carry information for specific languages being able to infer proper signatures, data types, etc alone. You must know them, name them as you wish, and obey the IO structures as planed by the author of the library (match data, sizes and alignments).
Check how other languages do it. Load and use DLLs / SOs. Xojo isn’t very different.
Your examples are for “other things”.
A standard dynamically loadable lib exposes the exported function names, but nothing about the parameters or returned values, those you need to know and write a proper compatible parameter list in your “compatible language” using compatible call convention, usually C convention.