Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to customize continuous silence/next sentence time? #45

Open
elongstreet88 opened this issue Oct 20, 2024 · 1 comment
Open

Comments

@elongstreet88
Copy link

elongstreet88 commented Oct 20, 2024

From the README:

...
// [Default: false] Continuous recognition.
  // If false:
  //    - on iOS 17-, recognition will run until no speech is detected for 3 seconds.
  //    - on iOS 18+ and Android, recognition will run until a final result is received.
  // Not supported on Android 12 and below.
  continuous: true,
...

Would it be possible to variabilze this into milliseconds, so that it could be set? In some tests, I've found that fast speakers that don't pause very much during speech cause a very long sentence to be synthesized and/or it the results event isn't fired for a long time.

It would be helpful to be able to either statically set a max results time (like 10 seconds) and also set the max silence between next sentence time.

@jamsch
Copy link
Owner

jamsch commented Oct 20, 2024

Hi @elongstreet88

Yep, that's on the cards to implement however I'm on the fence whether this should also modify the Android-equivalent timers (which they don't recommend you change). Right now I'm intending to implement two options for timer configs:

  • minimum input length time (which corresponds to Android's EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS)
  • max time to wait for no speech detection before stopping (which corresponds to Android's EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS)

I'll also have to research what defaults these are at least on Android com.google.android.tts / com.google.android.as so that it behaves similar on iOS, but I don't think this is documented anywhere so it'll have to be a guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants