Files
transcribe/pkg/output/json.go
2026-01-17 19:18:58 -06:00

20 lines
418 B
Go

package output
import (
"encoding/json"
"transcribe/internal/whisper"
)
// JSONFormatter formats transcription results as JSON
type JSONFormatter struct{}
// Format converts transcription result to JSON format
func (f *JSONFormatter) Format(result *whisper.TranscriptionResult) (string, error) {
data, err := json.MarshalIndent(result, "", " ")
if err != nil {
return "", err
}
return string(data), nil
}