[Infusion-users] change language textToSpeed

Justin Obara obara.justin at gmail.com
Tue Jan 19 14:32:46 UTC 2016


Hi Antonio,

I believe what you are asking is how to set the text to speech to read back Spanish text. The self voicing enactor does support the use of other languages, although it is up to the available synthesizers on the system, if they are supported. Unfortunately this switching of languages doesn’t happen automatically. I’ve filed an issue for this. ( https://issues.fluidproject.org/browse/FLUID-5843 ). However you can change the model value for the self voicing enactor to be set to Spanish by passing in a BCP 47 language tag to the self voicing enactor.

Rather than modifying any existing component grades, I’ll write up a couple new ones that you can drop into your code. These build on grades that are defined in the prefsEditorDemo.js file, so you’ll still need to keep that dependency.

fluid.defaults("demo.prefsEditor.progressiveEnhancementLang", {
    gradeNames: ["fluid.contextAware"],
    contextAwareness: {
        textToSpeech: {
            checks: {
                supportsTTS: {
                    contextValue: "{fluid.supportsTTS}",
                    gradeNames: "demo.prefsEditor.auxSchema.speakLang"
                }
            }
        }
    }
});

fluid.defaults("demo.prefsEditor.auxSchema.speakLang", {
    gradeNames: ["demo.prefsEditor.auxSchema.speak"],
    distributeOptions: {
        source: "{that}.options.lang",
        target: "{that}.options.auxiliarySchema.speak.enactor.model.utteranceOpts.lang"
    }
});

Additionally, you’ll need to make a modification to the the index.html file. Update the js starting line 79. To look like

$(document).ready(function () {
    var prefsEditor = fluid.prefs.create(".flc-prefsEditor-separatedPanel", {
        build: {
            gradeNames: [
                "fluid.prefs.auxSchema.starter", // this will add the starter set
                "demo.prefsEditor.auxSchema.simplify", // this will add the simplify adjuster and enactor
                "demo.prefsEditor.progressiveEnhancementLang" // progressive enhancment
            ],
            primarySchema: demo.prefsEditor.primarySchema,
            lang: "es-ES"
        }
    });
});

This change uses the new “demo.prefsEditor.progressiveEnhancementLang” grade and adds the lang option, which is set to es-ES in the example above. You could also add some extra code here to source the lang value from the lang attribute of the HTML element instead. 

Note: I’ve used es-ES instead of es-CO because my browser doesn't seem to support es-CO.

Hope that helps.

Thanks
Justin





On January 18, 2016 at 3:50:10 PM, Antonio jose paternina cardenas (apaterninajc at gmail.com) wrote:

Hello team,
my name is Antonio Paternina, and i from Colombia.

I am developer and I am implementing the options bar.
I'm trying to change the language to the control TextToSpeed ​​Infusion Bar
I am using the example used in this demo (https://github.com/fluid-project/infusion/blob/master/demos/prefsFramework/js/prefsEditorDemo.js)
I want to change specifically to reading Spanish.

thanks.
_______________________________________________  
Infusion-users mailing list  
Infusion-users at lists.idrc.ocad.ca  
http://lists.idrc.ocad.ca/mailman/listinfo/infusion-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idrc.ocad.ca/pipermail/infusion-users/attachments/20160119/78efe191/attachment.html>


More information about the Infusion-users mailing list