Voice recognition is one of those Chromium features that uses Google API. You must enable Speech API and billing, otherwise voice recognition will not work.
(语音识别是使用Google API的Chromium功能之一。您必须启用语音API和计费,否则语音识别将不起作用。)

Once you enable Speech API and billing, you can provide the keys to JxBrowser Chromium engine using one of the approaches described in the Chromium API Keys article.(启用语音API和计费后,您可以使用Chromium API密钥文章中介绍的方法之一将密钥提供给JxBrowser Chromium引擎。)

The following example demonstrates how to configure Chromium with your API keys and test voice recognition functionality:(以下示例演示了如何使用API​​密钥配置Chromium和测试语音识别功能:)

import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserPreferences;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;

import javax.swing.*;
import java.awt.*;

 * The sample demonstrates how to enable voice recognition functionality in Chromium
 * engine. By default, voice recognition functionality is disabled. To enable it you must
 * provide your Google API Keys to Chromium engine as shown in the example.
public class VoiceRecognitionSample {
    public static void main(String[] args) {
        BrowserPreferences.setChromiumVariable("GOOGLE_API_KEY", "My API Key");
        BrowserPreferences.setChromiumVariable("GOOGLE_DEFAULT_CLIENT_ID", "My Client ID");
        BrowserPreferences.setChromiumVariable("GOOGLE_DEFAULT_CLIENT_SECRET", "My Client Secret");

        Browser browser = new Browser();
        BrowserView view = new BrowserView(browser);

        JFrame frame = new JFrame();
        frame.add(view, BorderLayout.CENTER);
        frame.setSize(700, 500);