impress_voice_input/run.sh
impressionyang 8c2e787a25 feat: 添加 Windows 交叉编译支持与 ONNX Runtime MinGW 兼容方案
- 新增 C API shim (ort_api_shim.h) 解决 MinGW 与 ONNX Runtime 的 SAL 注解/_stdcall 兼容性问题
- 新增轻量级 C++ 包装器 (ort_minimal) 替代 onnxruntime_cxx_api.h
- cmake/dependencies.cmake 支持 Windows/ Linux 平台自动识别依赖路径
- 修复音频采集 paNonInterleaved bug(指针被误解析为 float 导致 RMS=inf)
- 修复 Windows 热键和 UI 相关代码
- 添加 MinGW 交叉编译工具链配置

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-11 11:50:16 +08:00

32 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Impress Voice Input 启动脚本
# 设置 ONNX Runtime / PortAudio 库路径并启动应用
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
BUILD_DIR="${SCRIPT_DIR}/build"
ONNXRUNTIME_LIB_DIR="${SCRIPT_DIR}/third_party/onnxruntime/lib"
PORTAUDIO_LIB_DIR="${SCRIPT_DIR}/third_party/portaudio/lib"
# 检查可执行文件
if [ ! -f "${BUILD_DIR}/impress_voice_input" ]; then
echo "错误:未找到可执行文件,请先编译:"
echo " mkdir -p build && cd build"
echo " cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo"
echo " cmake --build . -j\$(nproc)"
exit 1
fi
# 检查 ONNX Runtime
if [ ! -f "${ONNXRUNTIME_LIB_DIR}/libonnxruntime.so" ]; then
echo "警告ONNX Runtime 未部署,推理功能将不可用"
echo " 请按照 third_party/README.md 部署 ONNX Runtime"
fi
# 设置库路径ONNX Runtime 优先PortAudio 回退到系统)
export LD_LIBRARY_PATH="${ONNXRUNTIME_LIB_DIR}:${PORTAUDIO_LIB_DIR}:${LD_LIBRARY_PATH}"
# 启动应用
exec "${BUILD_DIR}/impress_voice_input" "$@"