noise suppression added via nnnoiseless + vad + gain-normalizer + few frontend changes
This commit is contained in:
parent
a640e6caea
commit
eb0d40bae6
73 changed files with 1235 additions and 112 deletions
|
|
@ -1,26 +1,15 @@
|
|||
import { writable, get } from "svelte/store"
|
||||
import { writable } from "svelte/store"
|
||||
import { invoke } from "@tauri-apps/api/core"
|
||||
|
||||
// ### LISTENING STATE
|
||||
// note: defaults to false since GUI doesn't have listening capability
|
||||
export const isListening = writable(false)
|
||||
// ### RUNNING STATE
|
||||
export const isJarvisRunning = writable(false)
|
||||
export const jarvisRamUsage = writable(0)
|
||||
export const jarvisCpuUsage = writable(0)
|
||||
|
||||
// ### ASSISTANT VOICE
|
||||
export const assistantVoice = writable("")
|
||||
|
||||
// load voice setting from db
|
||||
async function loadVoiceSetting() {
|
||||
try {
|
||||
const voice = await invoke<string>("db_read", { key: "assistant_voice" })
|
||||
assistantVoice.set(voice)
|
||||
} catch (err) {
|
||||
console.error("failed to load voice setting:", err)
|
||||
}
|
||||
}
|
||||
loadVoiceSetting()
|
||||
|
||||
// ### APP INFO
|
||||
// these are loaded once on startup
|
||||
export const appInfo = writable({
|
||||
tgOfficialLink: "",
|
||||
feedbackLink: "",
|
||||
|
|
@ -28,7 +17,17 @@ export const appInfo = writable({
|
|||
logFilePath: ""
|
||||
})
|
||||
|
||||
async function loadAppInfo() {
|
||||
// ### INIT FUNCTIONS (call these from a component)
|
||||
export async function loadVoiceSetting() {
|
||||
try {
|
||||
const voice = await invoke<string>("db_read", { key: "assistant_voice" })
|
||||
assistantVoice.set(voice)
|
||||
} catch (err) {
|
||||
console.error("failed to load voice setting:", err)
|
||||
}
|
||||
}
|
||||
|
||||
export async function loadAppInfo() {
|
||||
try {
|
||||
const [tg, feedback, repo, logPath] = await Promise.all([
|
||||
invoke<string>("get_tg_official_link"),
|
||||
|
|
@ -47,4 +46,31 @@ async function loadAppInfo() {
|
|||
console.error("failed to load app info:", err)
|
||||
}
|
||||
}
|
||||
loadAppInfo()
|
||||
|
||||
export async function updateJarvisStats() {
|
||||
try {
|
||||
const stats = await invoke<{running: boolean, ram_mb: number, cpu_usage: number}>("get_jarvis_app_stats")
|
||||
isJarvisRunning.set(stats.running)
|
||||
jarvisRamUsage.set(stats.ram_mb)
|
||||
jarvisCpuUsage.set(stats.cpu_usage)
|
||||
} catch (err) {
|
||||
console.error("failed to get jarvis stats:", err)
|
||||
}
|
||||
}
|
||||
|
||||
// polling manager
|
||||
let statsInterval: ReturnType<typeof setInterval> | null = null
|
||||
|
||||
export function startStatsPolling(intervalMs = 5000) {
|
||||
if (statsInterval) return // already running
|
||||
|
||||
updateJarvisStats()
|
||||
statsInterval = setInterval(updateJarvisStats, intervalMs)
|
||||
}
|
||||
|
||||
export function stopStatsPolling() {
|
||||
if (statsInterval) {
|
||||
clearInterval(statsInterval)
|
||||
statsInterval = null
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue