mirror of
https://github.com/Priler/jarvis.git
synced 2026-05-26 07:08:11 +00:00
BETA Fix4 changes
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
[{"assistant_voice":"\"jarvis-remake\"","selected_microphone":"\"0\"","api_key__picovoice":"\"Hl7tfFyDT+S6fLhcT2nngK2qXsbhAwMsrVVp0Y9G0A2IfLlsPTm9eg==\"","api_key__openai":"\"\""},{}]
|
|
||||||
@@ -3,4 +3,11 @@
|
|||||||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||||||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||||
|
|
||||||
Run C:/Program Files (x86)/Google/Chrome/Application/chrome.exe
|
RegRead, BrowserKeyName, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice, Progid
|
||||||
|
RegRead, BrowserFullCommand, HKEY_CLASSES_ROOT, %BrowserKeyName%\shell\open\command
|
||||||
|
StringGetPos, pos, BrowserFullCommand, ",,1
|
||||||
|
pos := --pos
|
||||||
|
StringMid, BrowserPathandEXE, BrowserFullCommand, 2, %pos%
|
||||||
|
Run, % BrowserPathandEXE
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
BIN
src-tauri/libpv_recorder.dll
Normal file
BIN
src-tauri/libpv_recorder.dll
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/alexa_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/alexa_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/americano_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/americano_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/blueberry_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/blueberry_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/bumblebee_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/bumblebee_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/computer_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/computer_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/grapefruit_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/grapefruit_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/grasshopper_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/grasshopper_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/hey barista_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/hey barista_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/hey google_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/hey google_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/hey siri_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/hey siri_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/jarvis_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/jarvis_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/ok google_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/ok google_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/pico clock_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/pico clock_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/picovoice_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/picovoice_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/porcupine_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/porcupine_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/keywords/terminator_windows.ppn
Normal file
BIN
src-tauri/picovoice/keywords/terminator_windows.ppn
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/android/arm64-v8a/libpv_porcupine.so
Normal file
BIN
src-tauri/picovoice/lib/android/arm64-v8a/libpv_porcupine.so
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/android/armeabi-v7a/libpv_porcupine.so
Normal file
BIN
src-tauri/picovoice/lib/android/armeabi-v7a/libpv_porcupine.so
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/android/x86/libpv_porcupine.so
Normal file
BIN
src-tauri/picovoice/lib/android/x86/libpv_porcupine.so
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/android/x86_64/libpv_porcupine.so
Normal file
BIN
src-tauri/picovoice/lib/android/x86_64/libpv_porcupine.so
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/common/porcupine_params.pv
Normal file
BIN
src-tauri/picovoice/lib/common/porcupine_params.pv
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/common/porcupine_params_ru.pv
Normal file
BIN
src-tauri/picovoice/lib/common/porcupine_params_ru.pv
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/linux/x86_64/libpv_porcupine.so
Normal file
BIN
src-tauri/picovoice/lib/linux/x86_64/libpv_porcupine.so
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/linux/x86_64/libpv_recorder.so
Normal file
BIN
src-tauri/picovoice/lib/linux/x86_64/libpv_recorder.so
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/mac/arm64/libpv_porcupine.dylib
Normal file
BIN
src-tauri/picovoice/lib/mac/arm64/libpv_porcupine.dylib
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/mac/arm64/libpv_recorder.dylib
Normal file
BIN
src-tauri/picovoice/lib/mac/arm64/libpv_recorder.dylib
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/mac/x86_64/libpv_porcupine.dylib
Normal file
BIN
src-tauri/picovoice/lib/mac/x86_64/libpv_porcupine.dylib
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/mac/x86_64/libpv_recorder.dylib
Normal file
BIN
src-tauri/picovoice/lib/mac/x86_64/libpv_recorder.dylib
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/windows/amd64/libpv_porcupine.dll
Normal file
BIN
src-tauri/picovoice/lib/windows/amd64/libpv_porcupine.dll
Normal file
Binary file not shown.
BIN
src-tauri/picovoice/lib/windows/amd64/libpv_recorder.dll
Normal file
BIN
src-tauri/picovoice/lib/windows/amd64/libpv_recorder.dll
Normal file
Binary file not shown.
@@ -9,6 +9,7 @@ use std::env::current_dir;
|
|||||||
// };
|
// };
|
||||||
|
|
||||||
pub const COMMANDS_PATH: &str = "commands/";
|
pub const COMMANDS_PATH: &str = "commands/";
|
||||||
|
pub const KEYWORDS_PATH: &str = "picovoice/keywords/";
|
||||||
|
|
||||||
pub const DB_FILE_NAME: &str = "app.db";
|
pub const DB_FILE_NAME: &str = "app.db";
|
||||||
pub const APP_VERSION: Option<&str> = option_env!("CARGO_PKG_VERSION");
|
pub const APP_VERSION: Option<&str> = option_env!("CARGO_PKG_VERSION");
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ use crate::DB;
|
|||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn db_read(key: &str) -> String {
|
pub fn db_read(key: &str) -> String {
|
||||||
if let Some(value) = DB.lock().unwrap().get(key) {
|
if let Some(value) = DB.lock().unwrap().get::<String>(key) {
|
||||||
value
|
return value
|
||||||
} else {
|
|
||||||
String::from("")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String::from("")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use porcupine::{BuiltinKeywords, Porcupine, PorcupineBuilder};
|
use porcupine::{BuiltinKeywords, Porcupine, PorcupineBuilder};
|
||||||
use pv_recorder::RecorderBuilder;
|
use pv_recorder::RecorderBuilder;
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
use crate::events::Payload;
|
use crate::events::Payload;
|
||||||
use tauri::Manager;
|
use tauri::Manager;
|
||||||
@@ -47,32 +48,39 @@ pub fn start_listening(app_handle: tauri::AppHandle) -> Result<bool, String> {
|
|||||||
|
|
||||||
// vars
|
// vars
|
||||||
let porcupine: Porcupine;
|
let porcupine: Porcupine;
|
||||||
let picovoice_api_key: String;
|
let mut picovoice_api_key: String = String::from("");
|
||||||
let selected_microphone: i32;
|
let selected_microphone: i32;
|
||||||
|
|
||||||
let mut start = SystemTime::now();
|
let mut start = SystemTime::now();
|
||||||
|
|
||||||
// Retrieve API key from DB
|
// Retrieve API key from DB
|
||||||
if let Some(pkey) = DB.lock().unwrap().get::<String>("api_key__picovoice") {
|
if let Some(pkey) = DB.lock().unwrap().get::<String>("api_key__picovoice") {
|
||||||
picovoice_api_key = pkey;
|
if !pkey.is_empty() {
|
||||||
} else {
|
picovoice_api_key = pkey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if picovoice_api_key.is_empty() {
|
||||||
return Err("Picovoice API key is not set!".into());
|
return Err("Picovoice API key is not set!".into());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create instance of Porcupine with the given API key
|
// Create instance of Porcupine with the given API key
|
||||||
if let Ok(pinstance) =
|
match PorcupineBuilder::new_with_keyword_paths(picovoice_api_key, &[Path::new(config::KEYWORDS_PATH).join("jarvis_windows.ppn")])
|
||||||
PorcupineBuilder::new_with_keywords(picovoice_api_key, &[BuiltinKeywords::Jarvis])
|
.sensitivities(&[1.0f32]) // max sensitivity possible
|
||||||
.sensitivities(&[1.0f32]) // max sensitivity possible
|
.init() {
|
||||||
.init()
|
Ok(pinstance) => {
|
||||||
{
|
// porcupine successfully initialized with the valid API key
|
||||||
// porcupine successfully initialized with the valid API key
|
println!("Porcupine successfully initialized with the valid API key ...");
|
||||||
porcupine = pinstance;
|
porcupine = pinstance;
|
||||||
} else {
|
}
|
||||||
// something went wrong
|
Err(e) => {
|
||||||
return Err(
|
println!("Porcupine error: either API key is not valid or there is no internet connection");
|
||||||
"Porcupine error: either API key is not valid or there is no internet connection"
|
println!("Error details: {}", e);
|
||||||
.into(),
|
return Err(
|
||||||
);
|
"Porcupine error: either API key is not valid or there is no internet connection"
|
||||||
|
.into(),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve microphone index
|
// Retrieve microphone index
|
||||||
|
|||||||
@@ -40,10 +40,12 @@
|
|||||||
"commands",
|
"commands",
|
||||||
"sound",
|
"sound",
|
||||||
"vosk/model_small",
|
"vosk/model_small",
|
||||||
|
"picovoice",
|
||||||
"libvosk.dll",
|
"libvosk.dll",
|
||||||
"libstdc++-6.dll",
|
"libstdc++-6.dll",
|
||||||
"libwinpthread-1.dll",
|
"libwinpthread-1.dll",
|
||||||
"libgcc_s_seh-1.dll"
|
"libgcc_s_seh-1.dll",
|
||||||
|
"libpv_recorder.dll"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"security": {
|
"security": {
|
||||||
|
|||||||
Reference in New Issue
Block a user