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

Expose Google Cloud Speech-to-text config #2

Closed
ilhamwahabi opened this issue Feb 23, 2021 · 3 comments
Closed

Expose Google Cloud Speech-to-text config #2

ilhamwahabi opened this issue Feb 23, 2021 · 3 comments

Comments

@ilhamwahabi
Copy link

Hi! Great library, really appreciate your work.

I want to create an app that's not based on US, so I need a way to configure the GCP config especially the language.
I think It's also good consideration if we expose another config so it will be customizable. What do you think?

I'm available if you would like for me to do pull request for this one.

Thank you.

@Riley-Brown
Copy link
Owner

This is a good idea, the google config can be found in the Hooks/index.tsx file on line 215, we can add an optional googleConfig param to the hook in order to overwrite the default values
ex:

  const config = {
        encoding: 'LINEAR16',
        languageCode: 'en-US',
        sampleRateHertz: sampleRate,
        ...googleConfig
      };

@Riley-Brown
Copy link
Owner

Riley-Brown commented Feb 26, 2021

These are the types for the google config, I can create the PR for this or if you want to feel free as well https://cloud.google.com/speech-to-text/docs/reference/rest/v1/RecognitionConfig

@Riley-Brown
Copy link
Owner

Just pushed version 0.4.0 with support for a custom googleCloudRecognitionConfig and speechRecognitionProperties params, added both to readme https://github.com/Riley-Brown/react-speech-to-text#googlecloudrecognitionconfig

Let me know if you run into any issues with new changes

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