Compare commits

...

2 Commits

Author SHA1 Message Date
Timofey Gelazoniya dacad9a4f6
add method to set source language 2023-10-07 22:20:26 +03:00
Timofey Gelazoniya 7d6be4b7d3
remove unnecessary flags 2023-10-07 22:19:51 +03:00
2 changed files with 10 additions and 3 deletions

View File

@ -41,9 +41,6 @@ func InitializeWhisperState(modelPath string) (*WhisperState, error) {
return nil, err
}
params.AddFlags(whisper.FlagNoContext)
params.AddFlags(whisper.FlagTokenTimestamps)
fmt.Printf("Params CPU Threads : %d\n", params.CpuThreads())
return &WhisperState{

View File

@ -86,6 +86,16 @@ func (this *FullParams) RemoveFlags(newflag eFullParamsFlags) {
this.cStruct.Flags = this.cStruct.Flags ^ newflag
}
func (this *FullParams) SetLanguage(language eLanguage) {
if this == nil {
return
} else if this.cStruct == nil {
return
}
this.cStruct.Language = language
}
/*using pfnNewSegment = HRESULT( __cdecl* )( iContext* ctx, uint32_t n_new, void* user_data ) noexcept;*/
type NewSegmentCallback_Type func(context *IContext, n_new uint32, user_data unsafe.Pointer) EWhisperHWND