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
560f679f
Commit
560f679f
authored
Dec 09, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move init to correct thread
parent
4abafb46
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
GAudioOutput.cc
src/GAudioOutput.cc
+0
-2
QGCAudioWorker.cpp
src/audio/QGCAudioWorker.cpp
+10
-2
No files found.
src/GAudioOutput.cc
View file @
560f679f
...
...
@@ -64,8 +64,6 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent),
worker
(
new
QGCAudioWorker
())
{
worker
->
moveToThread
(
thread
);
// Initialize within right thread context
worker
->
init
();
connect
(
this
,
SIGNAL
(
textToSpeak
(
QString
,
int
)),
worker
,
SLOT
(
say
(
QString
,
int
)));
connect
(
this
,
SIGNAL
(
beepOnce
()),
worker
,
SLOT
(
beep
()));
thread
->
start
();
...
...
src/audio/QGCAudioWorker.cpp
View file @
560f679f
...
...
@@ -94,6 +94,12 @@ QGCAudioWorker::~QGCAudioWorker()
void
QGCAudioWorker
::
say
(
QString
text
,
int
severity
)
{
static
bool
threadInit
=
false
;
if
(
!
threadInit
)
{
threadInit
=
true
;
init
();
}
if
(
!
muted
)
{
// Prepend high priority text with alert beep
...
...
@@ -109,8 +115,10 @@ void QGCAudioWorker::say(QString text, int severity)
#endif
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
pVoice
->
Speak
(
text
.
toStdWString
().
c_str
(),
SPF_DEFAULT
,
NULL
);
HRESULT
hr
=
pVoice
->
Speak
(
text
.
toStdWString
().
c_str
(),
SPF_DEFAULT
,
NULL
);
if
(
FAILED
(
hr
))
{
qDebug
()
<<
"Speak failed, HR:"
<<
QString
(
"%1"
).
arg
(
hr
,
0
,
16
);
}
#elif defined Q_OS_LINUX && defined QGC_SPEECH_ENABLED
// Set size of string for espeak: +1 for the null-character
unsigned
int
espeak_size
=
strlen
(
text
.
toStdString
().
c_str
())
+
1
;
...
...
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