diff --git a/bindings/ruby/ext/ruby_whisper.h b/bindings/ruby/ext/ruby_whisper.h index 2dba8adcc..4ed6a2720 100644 --- a/bindings/ruby/ext/ruby_whisper.h +++ b/bindings/ruby/ext/ruby_whisper.h @@ -132,19 +132,11 @@ typedef struct { #define GetParakeetParams(obj, rwpp) do { \ TypedData_Get_Struct((obj), ruby_whisper_parakeet_params, &ruby_whisper_parakeet_params_type, (rwpp)); \ - if (!(rwpp)->new_segment_callback_container) { \ - rb_raise(rb_eRuntimeError, "Not initialized"); \ - } \ - if (!(rwpp)->new_token_callback_container) { \ - rb_raise(rb_eRuntimeError, "Not initialized"); \ - } \ - if (!(rwpp)->progress_callback_container) { \ - rb_raise(rb_eRuntimeError, "Not initialized"); \ - } \ - if (!(rwpp)->encoder_begin_callback_container) { \ - rb_raise(rb_eRuntimeError, "Not initialized"); \ - } \ - if (!(rwpp)->abort_callback_container) { \ + if (!(rwpp)->new_segment_callback_container || \ + !(rwpp)->new_token_callback_container || \ + !(rwpp)->progress_callback_container || \ + !(rwpp)->encoder_begin_callback_container || \ + !(rwpp)->abort_callback_container) { \ rb_raise(rb_eRuntimeError, "Not initialized"); \ } \ } while (0) diff --git a/bindings/ruby/ext/ruby_whisper_parakeet_context.c b/bindings/ruby/ext/ruby_whisper_parakeet_context.c new file mode 100644 index 000000000..90bcda35e --- /dev/null +++ b/bindings/ruby/ext/ruby_whisper_parakeet_context.c @@ -0,0 +1,9 @@ +#include "ruby_whisper.h" + + + +void +init_ruby_whisper_parakeet_context(VALUE *mParakeet) +{ + VALUE cParakeetContext = rb_define_class_under(*mParakeet, "Context", rb_cObject); +}