Skip to content

Feature Request :: Check items by voice. #12

Description

@anthraxn8b

Hi!
I created a checklist with Java/Android that could fulfill this task - but I am not into C++ :-)
IMHO it would be a great feature and is not a big deal.

With VOSK you can define a list of expected words which makes it extremely reliable.
You could use the second path in the clist (separated by "|") (but better use an additional list of accepted words per checklist item)).

ChatGPT is optimistic ...

Goal: Add speech recognition (e.g., when the user says "check", it checks the current checklist item).

Requirements:

  • Modify the C++ code of xchecklist.
  • Integrate a speech recognition library (e.g., Vosk, a lightweight offline STT engine).
  • Hook the recognition trigger into the checklist advancement logic.

Steps to Modify xchecklist:

  1. Set up voice recognition (e.g., Vosk)
    Vosk is a good choice because it's:
  • Offline-capable.
  • Has C/C++ bindings.
  • Lightweight enough for plugins.

Install Vosk:

Add to xchecklist:

  • Integrate Vosk via its API.
  • Create a thread that listens for microphone input and looks for the word "check".
  1. Modify xchecklist Source
    Find the core logic where a checklist item is marked as complete.

Create a method like VoiceTriggerCheck(). Inside it, call the same function used when a user manually checks an item. Call this method from the Vosk callback whenever "check" is recognized.

  1. Implement the Voice Thread (example):
#include "vosk_api.h"
#include <thread>
#include <atomic>

std::atomic<bool> keep_listening(true);

void voice_listener_thread() {
    Model *model = new Model("model");
    KaldiRecognizer *recognizer = new KaldiRecognizer(model, 16000.0);

    PaStream *stream;
    Pa_Initialize();
    Pa_OpenDefaultStream(&stream, 1, 0, paInt16, 16000, 4096, nullptr, nullptr);
    Pa_StartStream(stream);

    short buffer[4096];
    while (keep_listening) {
        Pa_ReadStream(stream, buffer, 4096);
        if (recognizer->AcceptWaveform((char*)buffer, sizeof(buffer))) {
            std::string result = recognizer->Result();
            if (result.find("check") != std::string::npos) {
                MarkCurrentItemAsChecked(); // <-- you define this
            }
        }
    }

    Pa_StopStream(stream);
    Pa_CloseStream(stream);
    delete recognizer;
    delete model;
}

You’ll need to link against:

  • Vosk
  • PortAudio
  1. Launch the thread in plugin startup

std::thread(voice_listener_thread).detach();

Notes:

  • Add menu setting to enable/disable voice input.
  • Handle threading and plugin shutdown safely.
  • Debounce voice trigger (only one check per result).

Testing & Build:

  1. Compile the plugin with Vosk and PortAudio.
  2. Place the .xpl file in the appropriate X-Plane plugin folder.
  3. Test in X-Plane by saying “check” during checklist use.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions