Skip to content

Commit d1936c6

Browse files
author
Alexandre Lissy
committed
Refer to examples from doc
Fixes #2338
1 parent 9ce8c24 commit d1936c6

9 files changed

+180
-0
lines changed

doc/C-Examples.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
C API Usage example
2+
===================
3+
4+
Creating a model instance and loading model
5+
-------------------------------------------
6+
7+
.. literalinclude:: ../native_client/client.cc
8+
:language: c
9+
:linenos:
10+
:lines: 369-395
11+
12+
Performing inference
13+
--------------------
14+
15+
.. literalinclude:: ../native_client/client.cc
16+
:language: c
17+
:linenos:
18+
:lines: 55-106
19+
20+
Full source code
21+
----------------
22+
23+
See :download:`Full source code<../native_client/client.cc>`.

doc/DotNet-contrib-examples.rst

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.Net API contributed examples
2+
=============================
3+
4+
DeepSpeechWPF
5+
-------------
6+
7+
This examples demonstrates using the .Net Framework DeepSpeech NuGet to build
8+
a graphical Windows application using DeepSpeech
9+
10+
.. literalinclude:: ../examples/net_framework/DeepSpeechWPF/MainWindow.xaml.cs
11+
:language: csharp
12+
:linenos:
13+
14+
Full source code available under `examples/net_framework/DeepSpeechWPF/`.

doc/Java-Examples.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Java API Usage example
2+
======================
3+
4+
Creating a model instance and loading model
5+
-------------------------------------------
6+
7+
.. literalinclude:: ../native_client/java/app/src/main/java/org/mozilla/deepspeech/DeepSpeechActivity.java
8+
:language: java
9+
:linenos:
10+
:lines: 55
11+
12+
Performing inference
13+
--------------------
14+
15+
.. literalinclude:: ../native_client/java/app/src/main/java/org/mozilla/deepspeech/DeepSpeechActivity.java
16+
:language: java
17+
:linenos:
18+
:lines: 103
19+
20+
Full source code
21+
----------------
22+
23+
See :download:`Full source code<../native_client/java/app/src/main/java/org/mozilla/deepspeech/DeepSpeechActivity.java>`.

doc/NodeJS-Examples.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
JavaScript API Usage example
2+
=============================
3+
4+
Creating a model instance and loading model
5+
-------------------------------------------
6+
7+
.. literalinclude:: ../native_client/javascript/client.js
8+
:language: javascript
9+
:linenos:
10+
:lines: 102-112
11+
12+
Performing inference
13+
--------------------
14+
15+
.. literalinclude:: ../native_client/javascript/client.js
16+
:language: javascript
17+
:linenos:
18+
:lines: 120-124
19+
20+
Full source code
21+
----------------
22+
23+
See :download:`Full source code<../native_client/javascript/client.js>`.

doc/NodeJS-contrib-Examples.rst

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
JavaScript contributed examples
2+
===============================
3+
4+
NodeJS WAV
5+
----------
6+
7+
This example demonstrates a very basic usage of the NodeJS API
8+
9+
.. literalinclude:: ../examples/nodejs_wav/index.js
10+
:language: javascript
11+
:linenos:
12+
13+
Full source code available under `../examples/nodejs_wav/`.
14+
15+
FFMPEG VAD Streaming
16+
--------------------
17+
18+
This example demonstrates using the Streaming API with ffmpeg to perform some
19+
Voice-Activity-Detection.
20+
21+
.. literalinclude:: ../examples/ffmpeg_vad_streaming/index.js
22+
:language: javascript
23+
:linenos:
24+
25+
Full source code available under `../examples/ffmpeg_vad_streaming/`.

doc/Python-Examples.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Python API Usage example
2+
========================
3+
4+
Creating a model instance and loading model
5+
-------------------------------------------
6+
7+
.. literalinclude:: ../native_client/python/client.py
8+
:language: python
9+
:linenos:
10+
:lines: 80, 87
11+
12+
Performing inference
13+
--------------------
14+
15+
.. literalinclude:: ../native_client/python/client.py
16+
:language: python
17+
:linenos:
18+
:lines: 104-107
19+
20+
Full source code
21+
----------------
22+
23+
See :download:`Full source code<../native_client/python/client.py>`.

doc/Python-contrib-Examples.rst

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Python contributed examples
2+
===========================
3+
4+
Mic VAD Streaming
5+
-----------------
6+
7+
This example demonstrates getting audio from microphone, running
8+
Voice-Activity-Detection and then outputting text.
9+
10+
.. literalinclude:: ../examples/mic_vad_streaming/mic_vad_streaming.py
11+
:language: python
12+
:linenos:
13+
14+
Full source code available under `../examples/mic_vad_streaming/`.
15+
16+
VAD Transcriber
17+
---------------
18+
19+
This example demonstrates VAD-based transcription with both console and
20+
graphical interface.
21+
22+
.. literalinclude:: ../examples/vad_transcriber/wavTranscriber.py
23+
:language: python
24+
:linenos:
25+
26+
Full source code available under `../examples/vad_transcriber/wavTranscriber.py`.

doc/index.rst

+22
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,28 @@ Welcome to DeepSpeech's documentation!
3939

4040
Python-API
4141

42+
.. toctree::
43+
:maxdepth: 2
44+
:caption: Examples
45+
46+
C-Examples
47+
48+
NodeJS-Examples
49+
50+
Java-Examples
51+
52+
Python-Examples
53+
54+
.. toctree::
55+
:maxdepth: 2
56+
:caption: Contributed examples
57+
58+
DotNet-contrib-examples.rst
59+
60+
NodeJS-contrib-Examples
61+
62+
Python-contrib-Examples
63+
4264
Indices and tables
4365
==================
4466

taskcluster/docs-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ semver==2.8.1
33
sphinx==2.2.0
44
sphinx-js==2.8
55
sphinx-rtd-theme==0.4.3
6+
pygments==2.4.2

0 commit comments

Comments
 (0)