| | |
| | | } |
| | | } |
| | | |
| | | func TestXASREnablesHoldPreCapture(t *testing.T) { |
| | | if !(&xasrStreamingEngine{}).HoldPreCaptureEnabled() { |
| | | t.Fatal("X-ASR should enable hold pre-capture") |
| | | func TestSenseVoiceRequestsReleaseTailCaptureDelay(t *testing.T) { |
| | | got := (&sherpaEngine{backendKind: model.BackendSenseVoice}).ReleaseTailCaptureDelay() |
| | | if got != 100*time.Millisecond { |
| | | t.Fatalf("ReleaseTailCaptureDelay() = %v, want 100ms", got) |
| | | } |
| | | } |
| | | |
| | | func TestOfflineSherpaDoesNotRequestReleaseTailCapture(t *testing.T) { |
| | | if _, ok := any(&sherpaEngine{}).(ReleaseTailCaptureEngine); ok { |
| | | t.Fatal("offline sherpa engine should not request release tail capture") |
| | | func TestOtherSherpaModelsDoNotRequestReleaseTailCaptureDelay(t *testing.T) { |
| | | for _, backendKind := range []string{ |
| | | model.BackendMoonshine, |
| | | model.BackendTransducer, |
| | | model.BackendNemoTransducer, |
| | | model.BackendQwen3ASR, |
| | | } { |
| | | t.Run(backendKind, func(t *testing.T) { |
| | | got := (&sherpaEngine{backendKind: backendKind}).ReleaseTailCaptureDelay() |
| | | if got != 0 { |
| | | t.Fatalf("ReleaseTailCaptureDelay() = %v, want 0", got) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | func TestXASREnablesHoldPreCapture(t *testing.T) { |
| | | if !(&xasrStreamingEngine{}).HoldPreCaptureEnabled() { |
| | | t.Fatal("X-ASR should enable hold pre-capture") |
| | | } |
| | | } |
| | | |