+ * {
+ * "alternatives": [
+ * { "text": "one two three four five", "confidence": 0.97 },
+ * { "text": "one two three for five", "confidence": 0.03 },
+ * ]
+ * }
+ *
+ *
+ * @param max_alternatives - maximum alternatives to return from recognition results
+ */
+void vosk_recognizer_set_max_alternatives(VoskRecognizer *recognizer, int max_alternatives);
+
+
+/** Enables words with times in the output
+ *
+ *
+ * "result" : [{
+ * "conf" : 1.000000,
+ * "end" : 1.110000,
+ * "start" : 0.870000,
+ * "word" : "what"
+ * }, {
+ * "conf" : 1.000000,
+ * "end" : 1.530000,
+ * "start" : 1.110000,
+ * "word" : "zero"
+ * }, {
+ * "conf" : 1.000000,
+ * "end" : 1.950000,
+ * "start" : 1.530000,
+ * "word" : "zero"
+ * }, {
+ * "conf" : 1.000000,
+ * "end" : 2.340000,
+ * "start" : 1.950000,
+ * "word" : "zero"
+ * }, {
+ * "conf" : 1.000000,
+ * "end" : 2.610000,
+ * "start" : 2.340000,
+ * "word" : "one"
+ * }],
+ *
+ *
+ * @param words - boolean value
+ */
+void vosk_recognizer_set_words(VoskRecognizer *recognizer, int words);
+
+/** Like above return words and confidences in partial results
+ *
+ * @param partial_words - boolean value
+ */
+void vosk_recognizer_set_partial_words(VoskRecognizer *recognizer, int partial_words);
+
+/** Set NLSML output
+ * @param nlsml - boolean value
+ */
+void vosk_recognizer_set_nlsml(VoskRecognizer *recognizer, int nlsml);
+
+
+/** Accept voice data
+ *
+ * accept and process new chunk of voice data
+ *
+ * @param data - audio data in PCM 16-bit mono format
+ * @param length - length of the audio data
+ * @returns 1 if silence is occured and you can retrieve a new utterance with result method
+ * 0 if decoding continues
+ * -1 if exception occured */
+int vosk_recognizer_accept_waveform(VoskRecognizer *recognizer, const char *data, int length);
+
+
+/** Same as above but the version with the short data for language bindings where you have
+ * audio as array of shorts */
+int vosk_recognizer_accept_waveform_s(VoskRecognizer *recognizer, const short *data, int length);
+
+
+/** Same as above but the version with the float data for language bindings where you have
+ * audio as array of floats */
+int vosk_recognizer_accept_waveform_f(VoskRecognizer *recognizer, const float *data, int length);
+
+
+/** Returns speech recognition result
+ *
+ * @returns the result in JSON format which contains decoded line, decoded
+ * words, times in seconds and confidences. You can parse this result
+ * with any json parser
+ *
+ *
+ * {
+ * "text" : "what zero zero zero one"
+ * }
+ *
+ *
+ * If alternatives enabled it returns result with alternatives, see also vosk_recognizer_set_max_alternatives().
+ *
+ * If word times enabled returns word time, see also vosk_recognizer_set_word_times().
+ */
+const char *vosk_recognizer_result(VoskRecognizer *recognizer);
+
+
+/** Returns partial speech recognition
+ *
+ * @returns partial speech recognition text which is not yet finalized.
+ * result may change as recognizer process more data.
+ *
+ *
+ * {
+ * "partial" : "cyril one eight zero"
+ * }
+ *
+ */
+const char *vosk_recognizer_partial_result(VoskRecognizer *recognizer);
+
+
+/** Returns speech recognition result. Same as result, but doesn't wait for silence
+ * You usually call it in the end of the stream to get final bits of audio. It
+ * flushes the feature pipeline, so all remaining audio chunks got processed.
+ *
+ * @returns speech result in JSON format.
+ */
+const char *vosk_recognizer_final_result(VoskRecognizer *recognizer);
+
+
+/** Resets the recognizer
+ *
+ * Resets current results so the recognition can continue from scratch */
+void vosk_recognizer_reset(VoskRecognizer *recognizer);
+
+
+/** Releases recognizer object
+ *
+ * Underlying model is also unreferenced and if needed released */
+void vosk_recognizer_free(VoskRecognizer *recognizer);
+
+/** Set log level for Kaldi messages
+ *
+ * @param log_level the level
+ * 0 - default value to print info and error messages but no debug
+ * less than 0 - don't print info messages
+ * greather than 0 - more verbose mode
+ */
+void vosk_set_log_level(int log_level);
+
+/**
+ * Init, automatically select a CUDA device and allow multithreading.
+ * Must be called once from the main thread.
+ * Has no effect if HAVE_CUDA flag is not set.
+ */
+void vosk_gpu_init();
+
+/**
+ * Init CUDA device in a multi-threaded environment.
+ * Must be called for each thread.
+ * Has no effect if HAVE_CUDA flag is not set.
+ */
+void vosk_gpu_thread_init();
+
+/** Creates the batch recognizer object
+ *
+ * @returns model object or NULL if problem occured */
+VoskBatchModel *vosk_batch_model_new(const char *model_path);
+
+/** Releases batch model object */
+void vosk_batch_model_free(VoskBatchModel *model);
+
+/** Wait for the processing */
+void vosk_batch_model_wait(VoskBatchModel *model);
+
+/** Creates batch recognizer object
+ * @returns recognizer object or NULL if problem occured */
+VoskBatchRecognizer *vosk_batch_recognizer_new(VoskBatchModel *model, float sample_rate);
+
+/** Releases batch recognizer object */
+void vosk_batch_recognizer_free(VoskBatchRecognizer *recognizer);
+
+/** Accept batch voice data */
+void vosk_batch_recognizer_accept_waveform(VoskBatchRecognizer *recognizer, const char *data, int length);
+
+/** Set NLSML output
+ * @param nlsml - boolean value
+ */
+void vosk_batch_recognizer_set_nlsml(VoskBatchRecognizer *recognizer, int nlsml);
+
+/** Closes the stream */
+void vosk_batch_recognizer_finish_stream(VoskBatchRecognizer *recognizer);
+
+/** Return results */
+const char *vosk_batch_recognizer_front_result(VoskBatchRecognizer *recognizer);
+
+/** Release and free first retrieved result */
+void vosk_batch_recognizer_pop(VoskBatchRecognizer *recognizer);
+
+/** Get amount of pending chunks for more intelligent waiting */
+int vosk_batch_recognizer_get_pending_chunks(VoskBatchRecognizer *recognizer);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* VOSK_API_H */
diff --git a/src-tauri/vosk_build.py b/src-tauri/vosk_build.py
new file mode 100644
index 0000000..5a87fb2
--- /dev/null
+++ b/src-tauri/vosk_build.py
@@ -0,0 +1,36 @@
+# Simple python script used to
+# copy Vosk libraries to the "target" directory
+# after Rust build
+
+# Note that Rust build should be run via "cargo make
+ Сначала выберите тип на шаге 2.
`; - return; - } - - if (t === "exe") { - const wrap = document.createElement("div"); - wrap.innerHTML = ` -Шаги выполняются по порядку.
- - - `; - const list = f.querySelector("#steps-list"); - if (!state.action || state.action.type !== "multi") { - state.action = { type: "multi", steps: [] }; - } - const renderList = () => { - list.innerHTML = ""; - state.action.steps.forEach((step, idx) => { - const card = document.createElement("div"); - card.className = "step-card"; - card.innerHTML = ` -Минимум одна фраза. Идентификатор подставится автоматически из первой фразы.
-Модель предложит набор шагов. Их можно отредактировать перед сохранением.
- -p&&(p=e.lineIndent),J(a))f++;else{if(e.lineIndent
0){for(r=a,o=0;r>0;r--)(a=ee(l=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:ce(e,"expected hexadecimal character");e.result+=ne(o),e.position++}else ce(e,"unknown escape sequence");n=i=e.position}else J(l)?(pe(e,n,i,!0),ye(e,ge(e,!1,t)),n=i=e.position):e.position===e.lineStart&&me(e)?ce(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}ce(e,"unexpected end of the stream within a double quoted scalar")}(e,d)?y=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!z(i)&&!X(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),P.call(e.anchorMap,n)||ce(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ge(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,l,c,s,u,p=e.kind,f=e.result;if(z(u=e.input.charCodeAt(e.position))||X(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(z(i=e.input.charCodeAt(e.position+1))||n&&X(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==u;){if(58===u){if(z(i=e.input.charCodeAt(e.position+1))||n&&X(i))break}else if(35===u){if(z(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&me(e)||n&&X(u))break;if(J(u)){if(l=e.line,c=e.lineStart,s=e.lineIndent,ge(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=l,e.lineStart=c,e.lineIndent=s;break}}a&&(pe(e,r,o,!1),ye(e,e.line-l),r=o=e.position,a=!1),Q(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return pe(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,d,1===i)&&(y=!0,null===e.tag&&(e.tag="?")):(y=!0,null===e.tag&&null===e.anchor||ce(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===g&&(y=c&&be(e,h))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ce(e,'unacceptable node kind for !> tag; it should be "scalar", not "'+e.kind+'"'),s=0,u=e.implicitTypes.length;s"),null!==e.result&&f.kind!==e.kind&&ce(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ce(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||y}function ke(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(ge(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&ce(e,"directive name must not be less than one character in length");0!==r;){for(;Q(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!J(r));break}if(J(r))break;for(t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&he(e),P.call(ue,n)?ue[n](e,n,i):se(e,'unknown document directive "'+n+'"')}ge(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,ge(e,!0,-1)):a&&ce(e,"directives end mark is expected"),we(e,e.lineIndent-1,4,!1,!0),ge(e,!0,-1),e.checkLineBreaks&&H.test(e.input.slice(o,e.position))&&se(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&me(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,ge(e,!0,-1)):e.position