whisper-rs icon indicating copy to clipboard operation
whisper-rs copied to clipboard

Adds safe bindings for set_new_segment_callback

Open WindowsCmd opened this issue 1 year ago • 2 comments

As the title implies. Introduces set_segment_callback_safe.

WindowsCmd avatar Oct 28 '23 05:10 WindowsCmd

                self.fp.new_segment_callback_user_data = closure as *mut c_void;
                self.fp.new_segment_callback = Some(trampoline::<SegmentCallbackFn>);
                self.segment_calllback_safe = None; 

It is bug here. Should be:

                self.segment_calllback_safe = Some(Box::new(closure));

garyhai avatar Oct 30 '23 03:10 garyhai

As the title implies. Introduces set_segment_callback_safe.

Thanks! I already use it in the project vibe and it works great as is (although I created new one lossy to ignore bad utf-8 errors)

Does it gonna be merged?

thewh1teagle avatar Apr 13 '24 20:04 thewh1teagle

Superseded by #153

tazz4843 avatar Jun 03 '24 04:06 tazz4843