Skip to content

Commit

Permalink
Refer to examples from doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Lissy committed Oct 4, 2019
1 parent 9ce8c24 commit d1936c6
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 0 deletions.
23 changes: 23 additions & 0 deletions doc/C-Examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
C API Usage example
===================

Creating a model instance and loading model
-------------------------------------------

.. literalinclude:: ../native_client/client.cc
:language: c
:linenos:
:lines: 369-395

Performing inference
--------------------

.. literalinclude:: ../native_client/client.cc
:language: c
:linenos:
:lines: 55-106

Full source code
----------------

See :download:`Full source code<../native_client/client.cc>`.
14 changes: 14 additions & 0 deletions doc/DotNet-contrib-examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.Net API contributed examples
=============================

DeepSpeechWPF
-------------

This examples demonstrates using the .Net Framework DeepSpeech NuGet to build
a graphical Windows application using DeepSpeech

.. literalinclude:: ../examples/net_framework/DeepSpeechWPF/MainWindow.xaml.cs
:language: csharp
:linenos:

Full source code available under `examples/net_framework/DeepSpeechWPF/`.
23 changes: 23 additions & 0 deletions doc/Java-Examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Java API Usage example
======================

Creating a model instance and loading model
-------------------------------------------

.. literalinclude:: ../native_client/java/app/src/main/java/org/mozilla/deepspeech/DeepSpeechActivity.java
:language: java
:linenos:
:lines: 55

Performing inference
--------------------

.. literalinclude:: ../native_client/java/app/src/main/java/org/mozilla/deepspeech/DeepSpeechActivity.java
:language: java
:linenos:
:lines: 103

Full source code
----------------

See :download:`Full source code<../native_client/java/app/src/main/java/org/mozilla/deepspeech/DeepSpeechActivity.java>`.
23 changes: 23 additions & 0 deletions doc/NodeJS-Examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
JavaScript API Usage example
=============================

Creating a model instance and loading model
-------------------------------------------

.. literalinclude:: ../native_client/javascript/client.js
:language: javascript
:linenos:
:lines: 102-112

Performing inference
--------------------

.. literalinclude:: ../native_client/javascript/client.js
:language: javascript
:linenos:
:lines: 120-124

Full source code
----------------

See :download:`Full source code<../native_client/javascript/client.js>`.
25 changes: 25 additions & 0 deletions doc/NodeJS-contrib-Examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
JavaScript contributed examples
===============================

NodeJS WAV
----------

This example demonstrates a very basic usage of the NodeJS API

.. literalinclude:: ../examples/nodejs_wav/index.js
:language: javascript
:linenos:

Full source code available under `../examples/nodejs_wav/`.

FFMPEG VAD Streaming
--------------------

This example demonstrates using the Streaming API with ffmpeg to perform some
Voice-Activity-Detection.

.. literalinclude:: ../examples/ffmpeg_vad_streaming/index.js
:language: javascript
:linenos:

Full source code available under `../examples/ffmpeg_vad_streaming/`.
23 changes: 23 additions & 0 deletions doc/Python-Examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Python API Usage example
========================

Creating a model instance and loading model
-------------------------------------------

.. literalinclude:: ../native_client/python/client.py
:language: python
:linenos:
:lines: 80, 87

Performing inference
--------------------

.. literalinclude:: ../native_client/python/client.py
:language: python
:linenos:
:lines: 104-107

Full source code
----------------

See :download:`Full source code<../native_client/python/client.py>`.
26 changes: 26 additions & 0 deletions doc/Python-contrib-Examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Python contributed examples
===========================

Mic VAD Streaming
-----------------

This example demonstrates getting audio from microphone, running
Voice-Activity-Detection and then outputting text.

.. literalinclude:: ../examples/mic_vad_streaming/mic_vad_streaming.py
:language: python
:linenos:

Full source code available under `../examples/mic_vad_streaming/`.

VAD Transcriber
---------------

This example demonstrates VAD-based transcription with both console and
graphical interface.

.. literalinclude:: ../examples/vad_transcriber/wavTranscriber.py
:language: python
:linenos:

Full source code available under `../examples/vad_transcriber/wavTranscriber.py`.
22 changes: 22 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ Welcome to DeepSpeech's documentation!

Python-API

.. toctree::
:maxdepth: 2
:caption: Examples

C-Examples

NodeJS-Examples

Java-Examples

Python-Examples

.. toctree::
:maxdepth: 2
:caption: Contributed examples

DotNet-contrib-examples.rst

NodeJS-contrib-Examples

Python-contrib-Examples

Indices and tables
==================

Expand Down
1 change: 1 addition & 0 deletions taskcluster/docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ semver==2.8.1
sphinx==2.2.0
sphinx-js==2.8
sphinx-rtd-theme==0.4.3
pygments==2.4.2

0 comments on commit d1936c6

Please sign in to comment.