Page 1 of 1

CEF and PPAPI on Windows

PostPosted: Fri Jan 11, 2019 9:35 am
by jantoszek
Hi Everyone,

I need some help. A project I work on has switched from using .NETs built in web browser control to CEF (CefSharp specifically). Everything went smoothly and I'm very happy with what we accomplished so far.

One of the features we wanted to take advantage of was the Speech Synthesis web standard for TTS. After a day of research I learned that Chromium has implemented the standard but not the actual synthesizer, instead it relies on google's web apis for speech. This won't work for us as we need to be able to work offline.

The next logical step, so far as I am concerned, is to build a native extension to interact with Window's Sound API (SAPI). The Chrome documentation supports a number of ways to do this: Native Messaging, NPAPI, PPAPI, Native Client (NaCL) and the Portable Native Client (PNaCL).

This is were my research breaks down. It seems that CEF does not support Native Messaging, NaCL and PNaCL and both Chrome and CEF have deprecated NPAPI. Google is also dropping support for NaCL and PNaCL from Chrome (and Chromium). That leaves PPAPI. The problem I have is that all of the documentation for PPAPI resides under the NaCL. If NaCL is dropped, does that mean PPAPI goes with it? Is PPAPI well supported in the CEF? Do I run the risk of losing PPAPI support after google removes NaCL from Chrome/Chromium?

I also have other more general questions. Is this an appropriate way to enable TTS in my client? Is there anything I'm missing? Will PPAPI allow me to access the SAPI DLLs or am I limited to what's implemented in the sandbox?

Thanks in advance!

Re: CEF and PPAPI on Windows

PostPosted: Fri Jan 11, 2019 9:54 am
by magreenblatt
If it were me, I would probably implement something very simple. Create a JavaScript binding that exposes a function (like readText("Some text")). Then, pass "Some text" to the Windows Sound API when the message arrives in the browser process. You can additionally add a callback to JavaScript if you need to know when the speech has completed (or other status info).

For details on creating JavaScript bindings see https://bitbucket.org/chromiumembedded/ ... t-bindings