2022-12-20 06:54:33 +00:00
|
|
|
package whisper
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
// Bindings
|
|
|
|
whisper "github.com/ggerganov/whisper.cpp/bindings/go"
|
|
|
|
)
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// ERRORS
|
|
|
|
|
|
|
|
var (
|
2023-01-07 19:21:43 +00:00
|
|
|
ErrUnableToLoadModel = errors.New("unable to load model")
|
|
|
|
ErrInternalAppError = errors.New("internal application error")
|
|
|
|
ErrProcessingFailed = errors.New("processing failed")
|
|
|
|
ErrUnsupportedLanguage = errors.New("unsupported language")
|
|
|
|
ErrModelNotMultilingual = errors.New("model is not multilingual")
|
2022-12-20 06:54:33 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// CONSTANTS
|
|
|
|
|
|
|
|
// SampleRate is the sample rate of the audio data.
|
|
|
|
const SampleRate = whisper.SampleRate
|
|
|
|
|
|
|
|
// SampleBits is the number of bytes per sample.
|
|
|
|
const SampleBits = whisper.SampleBits
|