-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Not able to import in React.js | Not sure if browser support is available as no documentation about it #280
Comments
Is your application something that runs in the browser or on the server (via Node.js)? The samples in this repository only run on the server. |
@jmdobry it Brunson browser compiled using web pack on server for bundling Can you suggest any alternative for using on browser or how we can change it, we can try change and create a pull request |
You can manually make an HTTP request to the Google Cloud Speech API from the browser. You'll need an API Key to authenticate. With Angular 1.x, it might be something like: $http({
method: 'POST',
url: 'https://speech.googleapis.com/v1beta1/speech:syncrecognize',
params: {
key: 'YOUR_API_KEY'
},
data: {
config: {
encoding: 'LINEAR16', // customize for your audio
sampleRate: 16000 // customize for your audio
},
audio: {
content: 'as0af8s7d0fa9sd7f=' // base64-encoded string of the content of your audio file
// or if your audio file is in Google Cloud Storage, "uri" instead:
// uri: 'gs://your-bucket/your-audio-file'
}
}
}).then(...); I don't have a bigger example to give you at the moment, but when I do I'll post back here. |
Nice, only worry is, this will expose API key over browser, need to check |
That is the concern. We generally expect there to be a proxy between the browser and the Speech API, such as your own backend server. |
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip]
* ProductSearch GA * ProductSearch GA
* updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip]
* updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip]
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [1.19.0](googleapis/nodejs-ai-platform@v1.18.0...v1.19.0) (2022-03-24) ### Features * add data_item_schema_uri, annotation_schema_uri, explanation_specs to ModelEvaluationExplanationSpec in aiplatform v1 model_evaluation.proto ([b769264](googleapis/nodejs-ai-platform@b769264)) * add ImportModelEvaluation in aiplatform v1 model_service.proto ([#280](googleapis/nodejs-ai-platform#280)) ([b769264](googleapis/nodejs-ai-platform@b769264)) * add ImportModelEvaluation in aiplatform v1beta1 model_service.proto ([b769264](googleapis/nodejs-ai-platform@b769264)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
* Added create cluster sample for Cloud Dataproc * Modify test and slight change to Dataproc success message * Changed region tag to include 'dataproc' * changed dataproc imports to explicit v1 * Added create cluster sample for Cloud Dataproc Updated READMEs ignore createCluster until it lands Modify test and slight change to Dataproc success message changed dataproc imports to explicit v1 * Adding updated Dataproc quickstart * Added mocha commands imports to tests Co-authored-by: Benjamin E. Coe <[email protected]>
* Added create cluster sample for Cloud Dataproc * Modify test and slight change to Dataproc success message * Changed region tag to include 'dataproc' * changed dataproc imports to explicit v1 * Added create cluster sample for Cloud Dataproc Updated READMEs ignore createCluster until it lands Modify test and slight change to Dataproc success message changed dataproc imports to explicit v1 * Adding updated Dataproc quickstart * Added mocha commands imports to tests Co-authored-by: Benjamin E. Coe <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [1.19.0](googleapis/nodejs-ai-platform@v1.18.0...v1.19.0) (2022-03-24) ### Features * add data_item_schema_uri, annotation_schema_uri, explanation_specs to ModelEvaluationExplanationSpec in aiplatform v1 model_evaluation.proto ([b769264](googleapis/nodejs-ai-platform@b769264)) * add ImportModelEvaluation in aiplatform v1 model_service.proto ([#280](googleapis/nodejs-ai-platform#280)) ([b769264](googleapis/nodejs-ai-platform@b769264)) * add ImportModelEvaluation in aiplatform v1beta1 model_service.proto ([b769264](googleapis/nodejs-ai-platform@b769264)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Hi
I am referring this sample to use the Speech APIs in my React.js application
below is what i am trying to do
But this fails to instantiate the Speech object
Am i missing something or there is something which is not documented for use in React.js/Angular.js?
The text was updated successfully, but these errors were encountered: