Merge pull request #109 from Andreybest/master

This commit is contained in:
Niko 2024-01-08 14:54:26 +00:00 committed by GitHub
commit 849f07cb45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 3 deletions

View file

@ -4,7 +4,7 @@ exclude = ["examples/full_usage"]
[package]
name = "whisper-rs"
version = "0.10.0"
version = "0.10.1"
edition = "2021"
description = "Rust bindings for whisper.cpp"
license = "Unlicense"

View file

@ -53,6 +53,23 @@ pub fn get_lang_str(id: i32) -> Option<&'static str> {
}
}
/// Get the full string of the specified language name (e.g. 2 -> "german").
///
/// # Returns
/// The full string of the language, None if not found.
///
/// # C++ equivalent
/// `const char * whisper_lang_str_full(int id)`
pub fn get_lang_str_full(id: i32) -> Option<&'static str> {
let c_buf = unsafe { whisper_rs_sys::whisper_lang_str_full(id) };
if c_buf.is_null() {
None
} else {
let c_str = unsafe { CStr::from_ptr(c_buf) };
Some(c_str.to_str().unwrap())
}
}
/// Callback to control logging output: default behaviour is to print to stderr.
///
/// # Safety

View file

@ -1,6 +1,6 @@
[package]
name = "whisper-rs-sys"
version = "0.8.0"
version = "0.8.1"
edition = "2021"
description = "Rust bindings for whisper.cpp (FFI bindings)"
license = "Unlicense"

@ -1 +1 @@
Subproject commit d38af151a1ed5378c5a9ae368e767ed22c8ab141
Subproject commit 0b9af32a8b3fa7e2ae5f15a9a08f5b10394993f5