Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
1ea5313b
Commit
1ea5313b
authored
Feb 05, 2014
by
Bryant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speech library now uses QGC_SPEECH_ENABLED macro.
parent
beea5599
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
20 deletions
+23
-20
QGCExternalLibs.pri
QGCExternalLibs.pri
+4
-1
GAudioOutput.cc
src/GAudioOutput.cc
+13
-13
GAudioOutput.h
src/GAudioOutput.h
+6
-6
No files found.
QGCExternalLibs.pri
View file @
1ea5313b
...
...
@@ -532,24 +532,27 @@ MacBuild {
#
contains (DEFINES, DISABLE_SPEECH) {
message("Skipping support for speech output (manual override)")
DEFINES -= DISABLE_SPEECH
} else:LinuxBuild {
exists(/usr/include/flite) | exists(/usr/local/include/flite) {
message("Including support for speech output")
DEFINES += QGC_SPEECH_ENABLED
LIBS += \
-lflite_cmu_us_kal \
-lflite_usenglish \
-lflite_cmulex \
-lflite
} else {
DEFINES += DISABLE_SPEECH
warning("Skipping support for speech output (missing libraries, see README)")
}
}
# Mac support is built into OS 10.6+.
else:MacBuild {
message("Including support for speech output")
DEFINES += QGC_SPEECH_ENABLED
}
# Windows supports speech through native API.
else:WindowsBuild {
message("Including support for speech output")
DEFINES += QGC_SPEECH_ENABLED
}
src/GAudioOutput.cc
View file @
1ea5313b
...
...
@@ -37,12 +37,12 @@ This file is part of the QGROUNDCONTROL project
#include <QDebug>
#if defined Q_OS_MAC &&
!defined DISABLE_SPEECH
#if defined Q_OS_MAC &&
defined QGC_SPEECH_ENABLED
#include <ApplicationServices/ApplicationServices.h>
#endif
// Speech synthesis is only supported with MSVC compiler
#if defined _MSC_VER &&
!defined DISABLE_SPEECH
#if defined _MSC_VER &&
defined QGC_SPEECH_ENABLED
// Documentation: http://msdn.microsoft.com/en-us/library/ee125082%28v=VS.85%29.aspx
#include <sapi.h>
...
...
@@ -50,14 +50,14 @@ This file is part of the QGROUNDCONTROL project
//using System.Speech.Synthesis;
#endif
#if defined Q_OS_LINUX &&
!defined DISABLE_SPEECH
#if defined Q_OS_LINUX &&
defined QGC_SPEECH_ENABLED
extern
"C"
{
#include <flite/flite.h>
cst_voice
*
register_cmu_us_kal
(
const
char
*
voxdir
);
};
#endif
#if defined _MSC_VER &&
!defined DISABLE_SPEECH
#if defined _MSC_VER &&
defined QGC_SPEECH_ENABLED
ISpVoice
*
GAudioOutput
::
pVoice
=
NULL
;
#endif
...
...
@@ -96,11 +96,11 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent),
muted
=
settings
.
value
(
QGC_GAUDIOOUTPUT_KEY
+
"muted"
,
muted
).
toBool
();
#if defined Q_OS_LINUX &&
!defined DISABLE_SPEECH
#if defined Q_OS_LINUX &&
defined QGC_SPEECH_ENABLED
flite_init
();
#endif
#if defined _MSC_VER &&
!defined DISABLE_SPEECH
#if defined _MSC_VER &&
defined QGC_SPEECH_ENABLED
pVoice
=
NULL
;
if
(
FAILED
(
::
CoInitialize
(
NULL
)))
...
...
@@ -145,7 +145,7 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent),
GAudioOutput
::~
GAudioOutput
()
{
#if defined _MSC_VER &&
!defined DISABLE_SPEECH
#if defined _MSC_VER &&
defined QGC_SPEECH_ENABLED
pVoice
->
Release
();
pVoice
=
NULL
;
::
CoUninitialize
();
...
...
@@ -182,7 +182,7 @@ bool GAudioOutput::say(QString text, int severity)
{
// Speech synthesis is only supported with MSVC compiler
#if defined _MSC_VER &&
!defined DISABLE_SPEECH
#if defined _MSC_VER &&
defined QGC_SPEECH_ENABLED
/*SpeechSynthesizer synth = new SpeechSynthesizer();
synth.SelectVoice("Microsoft Anna");
synth.SpeakText(text.toStdString().c_str());
...
...
@@ -205,7 +205,7 @@ bool GAudioOutput::say(QString text, int severity)
}*/
#endif
#if defined Q_OS_LINUX &&
!defined DISABLE_SPEECH
#if defined Q_OS_LINUX &&
defined QGC_SPEECH_ENABLED
QTemporaryFile
file
;
file
.
setFileTemplate
(
"XXXXXX.wav"
);
...
...
@@ -222,7 +222,7 @@ bool GAudioOutput::say(QString text, int severity)
#endif
#if defined Q_OS_MAC &&
!defined DISABLE_SPEECH
#if defined Q_OS_MAC &&
defined QGC_SPEECH_ENABLED
// Slashes necessary to have the right start to the sentence
// copying data prevents SpeakString from reading additional chars
text
=
"
\\
"
+
text
;
...
...
@@ -339,14 +339,14 @@ void GAudioOutput::beep()
void
GAudioOutput
::
selectFemaleVoice
()
{
#if defined Q_OS_LINUX &&
!defined DISABLE_SPEECH
#if defined Q_OS_LINUX &&
defined QGC_SPEECH_ENABLED
//this->voice = register_cmu_us_slt(NULL);
#endif
}
void
GAudioOutput
::
selectMaleVoice
()
{
#if defined Q_OS_LINUX &&
!defined DISABLE_SPEECH
#if defined Q_OS_LINUX &&
defined QGC_SPEECH_ENABLED
//this->voice = register_cmu_us_rms(NULL);
#endif
}
...
...
@@ -354,7 +354,7 @@ void GAudioOutput::selectMaleVoice()
/*
void GAudioOutput::selectNeutralVoice()
{
#if defined Q_OS_LINUX &&
!defined DISABLE_SPEECH
#if defined Q_OS_LINUX &&
defined QGC_SPEECH_ENABLED
this->voice = register_cmu_us_awb(NULL);
#endif
}*/
...
...
src/GAudioOutput.h
View file @
1ea5313b
...
...
@@ -40,7 +40,7 @@ This file is part of the PIXHAWK project
#include <AudioOutput>
#endif
#ifdef Q_OS_LINUX
#if
!defined DISABLE_SPEECH
#if
defined QGC_SPEECH_ENABLED
//#include <flite/flite.h>
#endif
#include <phonon/MediaObject>
...
...
@@ -52,13 +52,13 @@ This file is part of the PIXHAWK project
#endif
/* For Snow leopard and later
#if defined Q_OS_MAC &
!defined DISABLE_SPEECH
#if defined Q_OS_MAC &
defined QGC_SPEECH_ENABLED
#include <NSSpeechSynthesizer.h>
#endif
*/
#if defined _MSC_VER &&
!defined DISABLE_SPEECH
#if defined _MSC_VER &&
defined QGC_SPEECH_ENABLED
// Documentation: http://msdn.microsoft.com/en-us/library/ee125082%28v=VS.85%29.aspx
#include <sapi.h>
#endif
...
...
@@ -111,13 +111,13 @@ signals:
void
mutedChanged
(
bool
);
protected:
#if defined Q_OS_MAC &&
!defined DISABLE_SPEECH
#if defined Q_OS_MAC &&
defined QGC_SPEECH_ENABLED
//NSSpeechSynthesizer
#endif
#if defined Q_OS_LINUX &&
!defined DISABLE_SPEECH
#if defined Q_OS_LINUX &&
defined QGC_SPEECH_ENABLED
//cst_voice* voice; ///< The flite voice object
#endif
#if defined _MSC_VER &&
!defined DISABLE_SPEECH
#if defined _MSC_VER &&
defined QGC_SPEECH_ENABLED
static
ISpVoice
*
pVoice
;
#endif
int
voiceIndex
;
///< The index of the flite voice to use (awb, slt, rms)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment