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
87338236
Commit
87338236
authored
Feb 24, 2014
by
Thomas Gubler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
espeak: cleanup
parent
eb3f48b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
22 deletions
+7
-22
GAudioOutput.cc
src/GAudioOutput.cc
+7
-22
No files found.
src/GAudioOutput.cc
View file @
87338236
...
...
@@ -26,6 +26,7 @@ This file is part of the QGROUNDCONTROL project
* @brief Implementation of audio output
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
* @author Thomas Gubler <thomasgubler@gmail.com>
*
*/
...
...
@@ -53,12 +54,6 @@ This file is part of the QGROUNDCONTROL project
#if defined Q_OS_LINUX && defined QGC_SPEECH_ENABLED
// Using eSpeak for speech synthesis: following https://github.com/mondhs/espeak-sample/blob/master/sampleSpeak.cpp
#include <espeak/speak_lib.h>
espeak_POSITION_TYPE
espeak_position_type
;
espeak_AUDIO_OUTPUT
espeak_output
=
AUDIO_OUTPUT_PLAYBACK
;
int
espeak_buflength
=
500
;
int
espeak_options
=
0
;
char
*
espeak_path
=
NULL
;
unsigned
int
espeak_flags
=
espeakCHARS_AUTO
;
#endif
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
...
...
@@ -101,18 +96,13 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent),
#if defined Q_OS_LINUX && defined QGC_SPEECH_ENABLED
espeak_Initialize
(
espeak_output
,
espeak_buflength
,
espeak_path
,
espeak_options
);
const
char
*
espeak_langNativeString
=
"en-uk"
;
//Default to US English
espeak_Initialize
(
AUDIO_OUTPUT_PLAYBACK
,
500
,
NULL
,
0
);
// initialize for playback with 500ms buffer and no options (see speak_lib.h)
espeak_VOICE
espeak_voice
;
memset
(
&
espeak_voice
,
0
,
sizeof
(
espeak_VOICE
));
// Zero out the voice first
espeak_voice
.
languages
=
espeak_langNativeString
;
espeak_voice
.
name
=
"klatt"
;
espeak_voice
.
variant
=
0
;
espeak_voice
.
gender
=
2
;
espeak_voice
.
languages
=
"en-uk"
;
// Default to British English
espeak_voice
.
name
=
"klatt"
;
// espeak voice name
espeak_voice
.
gender
=
2
;
// Female
espeak_SetVoiceByProperties
(
&
espeak_voice
);
// Rate of eSpeak can be changed if needed:
// espeak_PARAMETER rateParam = espeakRATE;
// espeak_SetParameter(rateParam , 150, 0);
#endif
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
...
...
@@ -221,13 +211,8 @@ bool GAudioOutput::say(QString text, int severity)
#endif
#if defined Q_OS_LINUX && defined QGC_SPEECH_ENABLED
unsigned
int
espeak_size
,
espeak_position
=
0
,
espeak_end_position
=
0
,
*
espeak_unique_identifier
=
NULL
;
void
*
espeak_user_data
=
NULL
;
espeak_size
=
strlen
(
text
.
toStdString
().
c_str
());
// qDebug() << "eSpeak: Saying " << text;
espeak_Synth
(
text
.
toStdString
().
c_str
(),
espeak_size
,
espeak_position
,
espeak_position_type
,
espeak_end_position
,
espeak_flags
,
espeak_unique_identifier
,
espeak_user_data
);
// qDebug() << "Done talking " << text;
unsigned
int
espeak_size
=
strlen
(
text
.
toStdString
().
c_str
());
espeak_Synth
(
text
.
toStdString
().
c_str
(),
espeak_size
,
0
,
POS_CHARACTER
,
0
,
espeakCHARS_AUTO
,
NULL
,
NULL
);
// see the documentation in speak_lib.h for the description of the arguments
#endif
#if defined Q_OS_MAC && defined QGC_SPEECH_ENABLED
...
...
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