5 Commits

Author SHA1 Message Date
dde206facd Merge pull request #1 from lukaskwkw/chore/update-readme-build
Add pre build step
2024-03-11 11:18:20 +01:00
2e92dd91cb Add pre build step 2024-03-11 11:06:16 +01:00
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 27 additions and 7 deletions

View File

@ -11,6 +11,20 @@ This API server enables audio transcription using the OpenAI Whisper models.
# Build from source
Before build make sure that **CGO_ENABLED** env is set to **1**
```
set CGO_ENABLED 1
```
or preferable set it parament. Then check it via
```
go env
```
Also you have to have installed gcc x64 i.e. by MYSYS
Download the sources and use `go build`.
For example, you can build using the following command:
@ -38,10 +52,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