3 Commits

Author SHA1 Message Date
dacad9a4f6 add method to set source language 2023-10-07 22:20:26 +03:00
7d6be4b7d3 remove unnecessary flags 2023-10-07 22:19:51 +03:00
7b0797cca1 update readme 2023-10-05 23:49:15 +03:00
3 changed files with 13 additions and 7 deletions

View File

@ -38,10 +38,9 @@ Receive a response in JSON format:
# Usage with [Obsidian](https://obsidian.md/)
To integrate this with the [Obsidian voice recognotion plugin](https://github.com/nikdanilov/whisper-obsidian-plugin), follow these steps:
1. Open the plugin's settings.
2. Set the following values:
1. Install [Obsidian voice recognotion plugin](https://github.com/nikdanilov/whisper-obsidian-plugin)
2. Open the plugin's settings.
3. Set the following values:
- API KEY: `sk-1`
- API URL: `http://localhost:3000/v1/audio/transcriptions`
- Model: `whisper-1`

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