This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync Private Repository | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| mirror-sync: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::collections::HashMap; | |
| use tauri::{ | |
| plugin::{Builder, TauriPlugin}, | |
| Runtime, | |
| }; | |
| fn create_init_script(vars: HashMap<&str, String>) -> String { | |
| let vars_str = vars | |
| .iter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import win32clipboard | |
| import win32con | |
| import win32gui | |
| import win32api | |
| import ctypes | |
| import threading | |
| import time | |
| # 手动定义 win32con 中缺失的常量 | |
| WM_CLIPBOARDUPDATE = 0x031D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ctypes | |
| import win32api | |
| import win32con | |
| import win32gui | |
| import pywintypes | |
| from ctypes import wintypes | |
| # 1. 使用 ctypes 定义 pywin32 未封装的 API 和结构体 (已完全修正) | |
| # ================================================================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use dark_light; | |
| use tauri::{ | |
| AppHandle, | |
| Manager, | |
| Theme, | |
| WebviewWindowBuilder, | |
| }; | |
| use crate::app_state::AppState; | |
| enum ConfigTheme { System, Light, Dark } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import threading | |
| import pyaudio | |
| from abc import ABC, abstractmethod | |
| from contextlib import contextmanager | |
| from loguru import logger | |
| class BaseRecorder(ABC): | |
| def __init__(self, frame_size: int, channels: int): | |
| self.frame_size = frame_size | |
| self.format = pyaudio.paInt16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Literal | |
| class SenseVoiceModel: | |
| def __init__(self, executable_path: str, model_path: str): | |
| self._executable_path = executable_path | |
| self._model_path = model_path | |
| @staticmethod | |
| def remove_timedata(transcript_text: str) -> str: | |
| import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sherpa_onnx | |
| import soundfile as sf | |
| import numpy as np | |
| from modelscope import snapshot_download | |
| sensevoice_model_id = "WEAAEW/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17" | |
| model_dir = snapshot_download(sensevoice_model_id, local_dir="./sensevoice") | |
| recognizer = sherpa_onnx.OfflineRecognizer.from_sense_voice( | |
| model=f"{model_dir}/model.onnx", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import noisereduce as nr | |
| from loguru import logger | |
| from pydub import AudioSegment | |
| from pydub.silence import split_on_silence | |
| def load_audio_file(audio_path: str) -> AudioSegment | None: | |
| try: | |
| audio = AudioSegment\ | |
| .from_file(audio_path)\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ----------------------------------------------------------------------------- | |
| # MSIX 图标资产生成脚本 (使用 ImageMagick) - v3 (最新语法) | |
| # | |
| # 用法: | |
| # bash generate-uwp-icon.sh <path_to_master_image.png> | |
| # | |
| # 描述: | |
| # 此脚本使用 ImageMagick 7+ 的最新、最简洁的语法,不会产生弃用警告。 | |
| # ----------------------------------------------------------------------------- |
NewerOlder