diff --git a/doc/C-Examples.rst b/doc/C-Examples.rst new file mode 100644 index 00000000..4bac45fe --- /dev/null +++ b/doc/C-Examples.rst @@ -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>`. diff --git a/doc/DotNet-contrib-examples.rst b/doc/DotNet-contrib-examples.rst new file mode 100644 index 00000000..67e6c8f3 --- /dev/null +++ b/doc/DotNet-contrib-examples.rst @@ -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/`. diff --git a/doc/Java-Examples.rst b/doc/Java-Examples.rst new file mode 100644 index 00000000..6e41bd61 --- /dev/null +++ b/doc/Java-Examples.rst @@ -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>`. diff --git a/doc/NodeJS-Examples.rst b/doc/NodeJS-Examples.rst new file mode 100644 index 00000000..23b4dab1 --- /dev/null +++ b/doc/NodeJS-Examples.rst @@ -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>`. diff --git a/doc/NodeJS-contrib-Examples.rst b/doc/NodeJS-contrib-Examples.rst new file mode 100644 index 00000000..f3c1d97c --- /dev/null +++ b/doc/NodeJS-contrib-Examples.rst @@ -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/`. diff --git a/doc/Python-Examples.rst b/doc/Python-Examples.rst new file mode 100644 index 00000000..30c8cf27 --- /dev/null +++ b/doc/Python-Examples.rst @@ -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>`. diff --git a/doc/Python-contrib-Examples.rst b/doc/Python-contrib-Examples.rst new file mode 100644 index 00000000..7c8adfd6 --- /dev/null +++ b/doc/Python-contrib-Examples.rst @@ -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`. diff --git a/doc/index.rst b/doc/index.rst index edfd7fee..99a1e45a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -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 ================== diff --git a/taskcluster/docs-requirements.txt b/taskcluster/docs-requirements.txt index 8ca245ff..66f7b29a 100644 --- a/taskcluster/docs-requirements.txt +++ b/taskcluster/docs-requirements.txt @@ -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