feat: Added relative audio path
This commit is contained in:
@@ -7,6 +7,17 @@ mod animation;
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![serial::get_serial_ports, serial::write_serial, serial::open_port, serial::close_port, animation::start])
|
||||
.setup(|app| {
|
||||
let resource_path = app.path_resolver()
|
||||
.resolve_resource("assets/audio.mp3")
|
||||
.expect("failed to resolve resource");
|
||||
|
||||
let mut audio_path = animation::AUDIO_PATH.lock().unwrap();
|
||||
|
||||
**audio_path = resource_path;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
|
Reference in New Issue
Block a user