diff --git a/src/whisper_ctx.rs b/src/whisper_ctx.rs index d1c4a50..d43f5e4 100644 --- a/src/whisper_ctx.rs +++ b/src/whisper_ctx.rs @@ -70,27 +70,6 @@ impl WhisperInnerContext { } } - /// Create a new WhisperContext from a buffer. - /// - /// # Arguments - /// * buffer: The buffer containing the model. - /// - /// # Returns - /// Ok(Self) on success, Err(WhisperError) on failure. - /// - /// # C++ equivalent - /// `struct whisper_context * whisper_init_from_buffer_no_state(void * buffer, size_t buffer_size)` - #[deprecated = "Use `new_from_buffer_with_params` instead"] - pub fn new_from_buffer(buffer: &[u8]) -> Result { - let ctx = unsafe { - whisper_rs_sys::whisper_init_from_buffer_no_state(buffer.as_ptr() as _, buffer.len()) - }; - if ctx.is_null() { - Err(WhisperError::InitError) - } else { - Ok(Self { ctx }) - } - } /// Convert the provided text into tokens. /// diff --git a/src/whisper_ctx_wrapper.rs b/src/whisper_ctx_wrapper.rs index cff0237..0e56658 100644 --- a/src/whisper_ctx_wrapper.rs +++ b/src/whisper_ctx_wrapper.rs @@ -51,21 +51,6 @@ impl WhisperContext { Ok(Self::wrap(ctx)) } - /// Create a new WhisperContext from a buffer. - /// - /// # Arguments - /// * buffer: The buffer containing the model. - /// - /// # Returns - /// Ok(Self) on success, Err(WhisperError) on failure. - /// - /// # C++ equivalent - /// `struct whisper_context * whisper_init_from_buffer_no_state(void * buffer, size_t buffer_size)` - #[deprecated = "Use `new_from_buffer_with_params` instead"] - pub fn new_from_buffer(buffer: &[u8]) -> Result { - let ctx = WhisperInnerContext::new_from_buffer(buffer)?; - Ok(Self::wrap(ctx)) - } /// Convert the provided text into tokens. ///