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:
- 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".
- 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.
- 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:
- 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:
- Compile the plugin with Vosk and PortAudio.
- Place the .xpl file in the appropriate X-Plane plugin folder.
- Test in X-Plane by saying “check” during checklist use.
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:
Steps to Modify xchecklist:
Vosk is a good choice because it's:
Install Vosk:
Add to xchecklist:
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.
You’ll need to link against:
std::thread(voice_listener_thread).detach();
Notes:
Testing & Build: