diff --git a/Plugins/Android/libwhisper.a b/Plugins/Android/libwhisper.a index bb4211d..7374450 100644 Binary files a/Plugins/Android/libwhisper.a and b/Plugins/Android/libwhisper.a differ diff --git a/Plugins/Linux/libwhisper.so b/Plugins/Linux/libwhisper.so index 1f00f49..773b466 100644 Binary files a/Plugins/Linux/libwhisper.so and b/Plugins/Linux/libwhisper.so differ diff --git a/Plugins/MacOS/libwhisper.dylib b/Plugins/MacOS/libwhisper.dylib index 45123a6..d023901 100644 Binary files a/Plugins/MacOS/libwhisper.dylib and b/Plugins/MacOS/libwhisper.dylib differ diff --git a/Plugins/Windows/libwhisper.dll b/Plugins/Windows/libwhisper.dll index 073beb6..528bcc0 100644 Binary files a/Plugins/Windows/libwhisper.dll and b/Plugins/Windows/libwhisper.dll differ diff --git a/Plugins/iOS/libwhisper.a b/Plugins/iOS/libwhisper.a index 5e2ec64..69be8cd 100644 Binary files a/Plugins/iOS/libwhisper.a and b/Plugins/iOS/libwhisper.a differ diff --git a/Runtime/Native/WhisperNativeParams.cs b/Runtime/Native/WhisperNativeParams.cs index 10de385..2789397 100644 --- a/Runtime/Native/WhisperNativeParams.cs +++ b/Runtime/Native/WhisperNativeParams.cs @@ -8,6 +8,7 @@ using whisper_context_ptr = System.IntPtr; using whisper_state_ptr = System.IntPtr; using whisper_token = System.Int32; +using System; namespace Whisper.Native { @@ -19,11 +20,11 @@ public enum WhisperSamplingStrategy [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate void whisper_new_segment_callback(whisper_context_ptr ctx, whisper_state_ptr state, - int n_new, System.IntPtr user_data); + int n_new, IntPtr user_data); [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate void whisper_progress_callback(whisper_context_ptr ctx, whisper_state_ptr state, - int progress, System.IntPtr user_data); + int progress, IntPtr user_data); /// /// This is direct copy of C++ struct. @@ -66,6 +67,7 @@ public unsafe struct WhisperNativeParams [MarshalAs(UnmanagedType.U1)] public bool translate; [MarshalAs(UnmanagedType.U1)] public bool no_context; // do not use past transcription (if any) as initial prompt for the decoder + [MarshalAs(UnmanagedType.U1)] bool no_timestamps; // do not generate timestamps [MarshalAs(UnmanagedType.U1)] public bool single_segment; // force single segment output (useful for streaming) [MarshalAs(UnmanagedType.U1)] public bool print_special; // print special tokens (e.g. , , , etc.) [MarshalAs(UnmanagedType.U1)] public bool print_progress; // print progress information @@ -83,8 +85,12 @@ public unsafe struct WhisperNativeParams // [EXPERIMENTAL] speed-up techniques // note: these can significantly reduce the quality of the output [MarshalAs(UnmanagedType.U1)] public bool speed_up; // speed-up the audio by 2x using Phase Vocoder + [MarshalAs(UnmanagedType.U1)] bool debug_mode; // enable debug_mode provides extra info (eg. Dump log_mel) public int audio_ctx; // overwrite the audio context size (0 = use default) + // [EXPERIMENTAL] [TDRZ] tinydiarize + [MarshalAs(UnmanagedType.U1)] bool tdrz_enable; // enable tinydiarize speaker turn detection + // tokens to provide to the whisper decoder as initial prompt // these are prepended to any existing text context from a previous call public byte* initial_prompt; @@ -129,18 +135,28 @@ struct beam_search_struct // called for every newly generated text segment public whisper_new_segment_callback new_segment_callback; - public System.IntPtr new_segment_callback_user_data; + public IntPtr new_segment_callback_user_data; // called on each progress update public whisper_progress_callback progress_callback; - public System.IntPtr progress_callback_user_data; + public IntPtr progress_callback_user_data; // called each time before the encoder starts void* encoder_begin_callback; void* encoder_begin_callback_user_data; + // called each time before ggml computation starts + void* abort_callback; + void* abort_callback_user_data; + // called by each decoder to filter obtained logits void* logits_filter_callback; void* logits_filter_callback_user_data; + + + IntPtr grammar_rules; + UIntPtr n_grammar_rules; + UIntPtr i_start_rule; + float grammar_penalty; } }