0.0.20241024 • Published 8 months ago

@maxim_mazurok/gapi.client.speech-v1 v0.0.20241024

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

TypeScript typings for Cloud Speech-to-Text API v1

Converts audio to text by applying powerful neural network models. For detailed description please check documentation.

Installing

Install typings for Cloud Speech-to-Text API:

npm install @types/gapi.client.speech-v1 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://speech.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.speech
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('speech', 'v1', () => {
  // now we can use:
  // gapi.client.speech
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
    'https://www.googleapis.com/auth/cloud-platform',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Cloud Speech-to-Text API resources:

/*
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
*/
await gapi.client.speech.operations.get({name: 'name'});

/*
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
*/
await gapi.client.speech.operations.list({});

/*
Performs asynchronous speech recognition: receive results via the google.longrunning.Operations interface. Returns either an `Operation.error` or an `Operation.response` which contains a `LongRunningRecognizeResponse` message. For more information on asynchronous speech recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
*/
await gapi.client.speech.speech.longrunningrecognize({});

/*
Performs synchronous speech recognition: receive results after all audio has been sent and processed.
*/
await gapi.client.speech.speech.recognize({});
0.0.20241024

8 months ago

0.0.20241017

9 months ago

0.0.20241010

9 months ago

0.0.20240926

9 months ago

0.0.20240917

10 months ago

0.0.20241005

9 months ago

0.0.20240905

10 months ago

0.0.20240916

10 months ago

0.0.20240827

10 months ago

0.0.20240828

10 months ago

0.0.20240530

1 year ago

0.0.20240808

11 months ago

0.0.20240806

11 months ago

0.0.20240802

11 months ago

0.0.20240605

1 year ago

0.0.20240523

1 year ago

0.0.20240819

11 months ago

0.0.20240617

1 year ago

0.0.20240625

1 year ago

0.0.20240704

12 months ago

0.0.20240516

1 year ago

0.0.20240509

1 year ago

0.0.20240502

1 year ago

0.0.20240425

1 year ago

0.0.20240419

1 year ago

0.0.20240405

1 year ago

0.0.20240329

1 year ago

0.0.20240321

1 year ago

0.0.20240306

1 year ago

0.0.20240222

1 year ago

0.0.20240221

1 year ago

0.0.20240208

1 year ago

0.0.20240205

1 year ago

0.0.20240130

1 year ago

0.0.20240118

1 year ago

0.0.20240112

1 year ago

0.0.20240108

1 year ago

0.0.20231213

2 years ago

0.0.20231128

2 years ago

0.0.20230817

2 years ago

0.0.20230815

2 years ago

0.0.20231110

2 years ago

0.0.20231115

2 years ago

0.0.20230804

2 years ago

0.0.20230922

2 years ago

0.0.20230724

2 years ago

0.0.20231024

2 years ago

0.0.20230718

2 years ago

0.0.20230710

2 years ago

0.0.20230914

2 years ago

0.0.20231012

2 years ago

0.0.20230908

2 years ago

0.0.20230705

2 years ago

0.0.20230901

2 years ago

0.0.20231002

2 years ago

0.0.20230511

2 years ago

0.0.20230608

2 years ago

0.0.20230522

2 years ago

0.0.20230605

2 years ago

0.0.20230428

2 years ago

0.0.20230313

2 years ago

0.0.20230418

2 years ago

0.0.20230323

2 years ago

0.0.20230320

2 years ago

0.0.20230420

2 years ago

0.0.20230228

2 years ago

0.0.20230306

2 years ago

0.0.20230330

2 years ago

0.0.20230131

2 years ago

0.0.20230213

2 years ago

0.0.20230221

2 years ago

0.0.20230106

2 years ago

0.0.20221115

3 years ago

0.0.20221213

3 years ago

0.0.20221202

3 years ago

0.0.20230119

2 years ago

0.0.20230113

2 years ago

0.0.20221219

3 years ago

0.0.20221020

3 years ago

0.0.20221007

3 years ago

0.0.20221028

3 years ago

0.0.20220921

3 years ago

0.0.20220818

3 years ago

0.0.20220908

3 years ago

0.0.20220825

3 years ago

0.0.20220915

3 years ago

0.0.20220811

3 years ago

0.0.20220808

3 years ago