兼容windows
This commit is contained in:
parent
bba78d1dca
commit
d8759d56c6
2310
src-tauri/gen/schemas/windows-schema.json
Normal file
2310
src-tauri/gen/schemas/windows-schema.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -15,6 +15,7 @@ impl AudioPipeline {
|
|||||||
|
|
||||||
let output_path = workspace.join("normalized.wav");
|
let output_path = workspace.join("normalized.wav");
|
||||||
let mut command = Command::new(ffmpeg_path);
|
let mut command = Command::new(ffmpeg_path);
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
if let Some(lib_dir) = ffmpeg_path.parent().and_then(|bin_dir| bin_dir.parent()).map(|root| root.join("lib")) {
|
if let Some(lib_dir) = ffmpeg_path.parent().and_then(|bin_dir| bin_dir.parent()).map(|root| root.join("lib")) {
|
||||||
if lib_dir.exists() {
|
if lib_dir.exists() {
|
||||||
command.env("DYLD_FALLBACK_LIBRARY_PATH", &lib_dir);
|
command.env("DYLD_FALLBACK_LIBRARY_PATH", &lib_dir);
|
||||||
|
|||||||
@ -26,6 +26,13 @@ const DEFAULT_VAD_MODEL: &str = "model/silero_vad.onnx";
|
|||||||
const DEFAULT_FFMPEG_BINARY: &str = "vendor/ffmpeg/macos-arm64/bin/ffmpeg";
|
const DEFAULT_FFMPEG_BINARY: &str = "vendor/ffmpeg/macos-arm64/bin/ffmpeg";
|
||||||
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
|
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
|
||||||
const DEFAULT_FFMPEG_BINARY: &str = "vendor/ffmpeg/macos-x86_64/bin/ffmpeg";
|
const DEFAULT_FFMPEG_BINARY: &str = "vendor/ffmpeg/macos-x86_64/bin/ffmpeg";
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
const DEFAULT_FFMPEG_BINARY: &str = "vendor/ffmpeg/windows-x86_64/bin/ffmpeg.exe";
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
const FFMPEG_BIN_NAME: &str = "ffmpeg";
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
const FFMPEG_BIN_NAME: &str = "ffmpeg.exe";
|
||||||
|
|
||||||
pub async fn start_task(
|
pub async fn start_task(
|
||||||
app: tauri::AppHandle,
|
app: tauri::AppHandle,
|
||||||
@ -128,7 +135,7 @@ fn resolve_ffmpeg_path(app: &tauri::AppHandle) -> Option<PathBuf> {
|
|||||||
|
|
||||||
let path_var = std::env::var_os("PATH")?;
|
let path_var = std::env::var_os("PATH")?;
|
||||||
for directory in std::env::split_paths(&path_var) {
|
for directory in std::env::split_paths(&path_var) {
|
||||||
let candidate = directory.join("ffmpeg");
|
let candidate = directory.join(FFMPEG_BIN_NAME);
|
||||||
if candidate.exists() {
|
if candidate.exists() {
|
||||||
return Some(candidate);
|
return Some(candidate);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user