32 lines
844 B
ReStructuredText
32 lines
844 B
ReStructuredText
.. _js-api-example:
|
|
|
|
JavaScript API Usage example
|
|
=============================
|
|
|
|
Examples are from `native_client/javascript/client.ts`.
|
|
|
|
Creating a model instance and loading model
|
|
-------------------------------------------
|
|
|
|
.. literalinclude:: ../native_client/javascript/client.ts
|
|
:language: javascript
|
|
:linenos:
|
|
:lineno-match:
|
|
:start-after: sphinx-doc: js_ref_model_start
|
|
:end-before: sphinx-doc: js_ref_model_stop
|
|
|
|
Transcribing audio with the loaded model
|
|
----------------------------------------
|
|
|
|
.. literalinclude:: ../native_client/javascript/client.ts
|
|
:language: javascript
|
|
:linenos:
|
|
:lineno-match:
|
|
:start-after: sphinx-doc: js_ref_inference_start
|
|
:end-before: sphinx-doc: js_ref_inference_stop
|
|
|
|
Full source code
|
|
----------------
|
|
|
|
See :download:`Full source code<../native_client/javascript/client.ts>`.
|