سؤال

Currently, the Chrome x-webkit-speech seems only works well with English, can it be with other languages?

هل كانت مفيدة؟

المحلول 2

Add an attribute to <body> like

<body lang="zh-Hans">

No official doc for this point, just my practice.

نصائح أخرى

You can also add the lang attribute to your <input> element:

<input  type="text"  lang="es-MX"  x-webkit-speech  speech  onwebkitspeechchange="this.form.submit();" />

This way you can have multiple controls in different languges in your page.

Cheers!

The x-webkit-speech attribute has been deprecated for over a year now. In favor of the JavaScript Speech recognition API. I made a JS module that impliments the API for <input>s:

Speech input | Github

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top