Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porcupine Issue: why build Mac version will return error ? #1326

Open
2 tasks done
li-yu-tfs opened this issue Oct 25, 2024 · 0 comments
Open
2 tasks done

Porcupine Issue: why build Mac version will return error ? #1326

li-yu-tfs opened this issue Oct 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@li-yu-tfs
Copy link

Have you checked the docs and existing issues?

  • I have read all of the relevant Picovoice Porcupine docs
  • I have searched the existing issues for Porcupine

SDK

Rust

Porcupine package version

3.0.3

Framework version

2.0.6

Platform

macOS (x86_64, arm64)

OS/Browser version

14.6.1

Describe the bug

when we use rust and build macos version, will return this error

Couldn't find model file at /Users/xxxxx/work/geneai-desktop-assistant/src-tauri/target/release/build/pv_porcupine-d1fe74abd593b99b/out/lib/common/porcupine_params.pv with status 'ArgumentError'

this is my code. i have use library_path add libpv_porcupine libs. but now return coludn't find porcupine_params.pv lib.

so, how to add porcupine_params.pv lib ?

let library_path = if cfg!(target_os = "windows") {
"src/libs/porcupine/windows_amd64/libpv_porcupine.dll"
} else if cfg!(target_os = "macos") {
if cfg!(target_arch = "x86_64") {
"src/libs/porcupine/mac_x86_64/libpv_porcupine.dylib"
} else if cfg!(target_arch = "aarch64") {
"src/libs/porcupine/mac_arm64/libpv_porcupine.dylib"
} else {

        return;
    }
} else {

    return;
};

let real_library_path = match app_handle
    .path()
    .resolve(library_path, BaseDirectory::Resource)
{
    Ok(path) => {
    
        path
    }
    Err(e) => {
      
        return;
    }
};



let mut porcupine = None;
for &access_key in &access_keys {
    match PorcupineBuilder::new_with_keyword_paths(access_key, &[PathBuf::from(&real_path)])
        .library_path(&real_library_path)
        .sensitivities(&[0.5])
        .init()
    {
        Ok(p) => {
            porcupine = Some(p);
          
            break;
        }
        Err(e) => {
          
            continue;
        }
    }
}

Steps To Reproduce

none

Expected Behavior

don't return any error

@li-yu-tfs li-yu-tfs added the bug Something isn't working label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant