diff options
author | Tuomas Tuononen <tuomas.tuononen@code-q.fi> | 2015-09-10 16:44:43 +0300 |
---|---|---|
committer | Tuomas Tuononen <tuomas.tuononen@code-q.fi> | 2015-09-21 08:10:39 +0000 |
commit | f2590a924c71d0d756e7f5b3a3b2b19076769b2d (patch) | |
tree | e1a35410feafc0124b453fc9b9095dc9eec539ca /src/asr/qspeechrecognition.cpp | |
parent | 117af1045d2d87a0d1fefe9404929c28af2df80d (diff) |
SpeechRecognition: Add a couple of code example snippets
Change-Id: I1c23f7b1aa72188ba8f52c84935904ca6eaf042f
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/asr/qspeechrecognition.cpp')
-rwxr-xr-x | src/asr/qspeechrecognition.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/asr/qspeechrecognition.cpp b/src/asr/qspeechrecognition.cpp index 7c7568c..d7a8790 100755 --- a/src/asr/qspeechrecognition.cpp +++ b/src/asr/qspeechrecognition.cpp @@ -61,6 +61,29 @@ Q_LOGGING_CATEGORY(lcSpeechAsr, "qt.speech.asr") Unless otherwise mentioned, all the methods in this API return immediately and are handled asynchronously (in the call order). + + \section1 Initialization + + The following example creates a QSpeechRecognition instance with PocketSphinx engine + and creates one grammar. The acoustic model and dictionary for the given locale are + assumed to be found in the default resource directory for the engine. + + \snippet asr/speechrecognition.cpp Init + + \section1 Basic Control + + The following example method starts and stops speech recognition for the grammar that + was created above: + + \snippet asr/speechrecognition.cpp Start and stop + + After calling \l {QSpeechRecognition::}{startListening()}, the application receives a + \l {QSpeechRecognition::}{listeningStarted()} signal as soon as audio recording has been + started. + + After calling \l {QSpeechRecognition::}{stopListening()}, the application first receives a + \l {QSpeechRecognition::}{listeningStopped()} signal. Later, if a recognition result is + available, a \l {QSpeechRecognition::}{result()} signal is received. */ /*! |