improve notifier + add transcriber

This commit is contained in:
LeonardoTrapani
2025-08-16 16:17:48 +02:00
parent 688152ea13
commit feda62a7d4
8 changed files with 492 additions and 47 deletions
+39
View File
@@ -0,0 +1,39 @@
package transcriber
import (
"context"
"time"
"github.com/leonardotrapani/hyprvoice/internal/recording"
)
type TranscriptionResult struct {
Text string
Timestamp time.Time
IsFinal bool
}
type Transcriber interface {
Start(ctx context.Context, frameCh <-chan recording.AudioFrame) (<-chan error, error)
Stop() error
GetTranscription() (string, error)
}
type Config struct {
Provider string
APIKey string
Language string
ChunkSize int
BufferTime time.Duration
Model string
}
func DefaultConfig() Config {
return Config{
Provider: "openai",
Language: "en",
ChunkSize: 16384,
BufferTime: 2 * time.Second,
Model: "whisper-1",
}
}