| | |
| | | Close() |
| | | } |
| | | |
| | | // StreamingEngine is implemented by engines that can expose partial results |
| | | // while audio is still being captured. |
| | | type StreamingEngine interface { |
| | | NewStreamingSession() (StreamingSession, error) |
| | | } |
| | | |
| | | // StreamingSession receives incremental 16kHz mono PCM and returns the current |
| | | // best transcript for the active utterance. |
| | | type StreamingSession interface { |
| | | Accept(samples []float32) (string, error) |
| | | Finish() (string, error) |
| | | Close() |
| | | } |
| | | |
| | | // ModelDir returns the path to the sensevoice model directory. |
| | | func ModelDir() string { |
| | | resolved, err := resolveCurrentModel() |
| | |
| | | |
| | | func isSupportedBackend(backend string) bool { |
| | | switch backend { |
| | | case model.BackendSenseVoice, model.BackendMoonshine, model.BackendNemoTransducer, model.BackendQwen3ASR: |
| | | case model.BackendSenseVoice, model.BackendMoonshine, model.BackendNemoTransducer, model.BackendQwen3ASR, model.BackendXASRStreaming: |
| | | return true |
| | | default: |
| | | return false |