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
0528d871
Commit
0528d871
authored
Apr 29, 2010
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quick fix for flite in linux
parent
146474c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
26 deletions
+38
-26
qgroundcontrol.pri
qgroundcontrol.pri
+9
-8
GAudioOutput.cc
src/GAudioOutput.cc
+19
-16
GAudioOutput.h
src/GAudioOutput.h
+10
-2
No files found.
qgroundcontrol.pri
View file @
0528d871
...
...
@@ -97,27 +97,28 @@ linux-g++ {
DESTDIR = $$BASEDIR
}
INCLUDEPATH += /usr/include \
$$BASEDIR/lib/flite/include \
$$BASEDIR/lib/flite/lang
#
$$BASEDIR/lib/flite/include \
#
$$BASEDIR/lib/flite/lang
HARDWARE_PLATFORM = $$system(uname -a)
contains( HARDWARE_PLATFORM, x86_64 ) {
# 64-bit Linux
LIBS += \
-L$$BASEDIR/lib/flite/linux64
#
LIBS += \
#
-L$$BASEDIR/lib/flite/linux64
message(Building for GNU/Linux 64bit/x64)
} else {
# 32-bit Linux
LIBS += \
-L$$BASEDIR/lib/flite/linux32
#
LIBS += \
#
-L$$BASEDIR/lib/flite/linux32
message(Building for GNU/Linux 32bit/i386)
}
LIBS += -lm \
-lflite_cmu_us_rms \
-lflite_cmu_us_slt \
#
-lflite_cmu_us_rms \
#
-lflite_cmu_us_slt \
-lflite_usenglish \
-lflite_cmulex \
-lflite_cmu_us_kal16 \
-lflite \
-lSDL \
-lSDLmain
...
...
src/GAudioOutput.cc
View file @
0528d871
...
...
@@ -47,21 +47,23 @@ using System;
using
System
.
Speech
.
Synthesis
;
#endif
#ifdef Q_OS_LINUX
extern
"C"
{
#include <
flite.h>
#include <cmu_us_awb/voxdefs.h>
//
#ifdef Q_OS_LINUX
//
extern "C" {
//#include <flite/
flite.h>
//
#include <cmu_us_awb/voxdefs.h>
//#include <cmu_us_slt/voxdefs.h>
//cst_voice *REGISTER_VOX(const char *voxdir);
//void UNREGISTER_VOX(cst_voice *vox);
//cst_voice *register_cmu_us_awb(const char *voxdir);
//void unregister_cmu_us_awb(cst_voice *vox);
cst_voice
*
register_cmu_us_slt
(
const
char
*
voxdir
);
void
unregister_cmu_us_slt
(
cst_voice
*
vox
);
cst_voice
*
register_cmu_us_rms
(
const
char
*
voxdir
);
void
unregister_cmu_us_rms
(
cst_voice
*
vox
);
};
#endif
//cst_voice *register_cmu_us_slt(const char *voxdir);
//void unregister_cmu_us_slt(cst_voice *vox);
//cst_voice *register_cmu_us_rms(const char *voxdir);
//void unregister_cmu_us_rms(cst_voice *vox);
//};
//#endif
/**
* This class follows the singleton design pattern
...
...
@@ -84,7 +86,7 @@ GAudioOutput* GAudioOutput::instance()
GAudioOutput
::
GAudioOutput
(
QObject
*
parent
)
:
QObject
(
parent
),
#ifdef Q_OS_LINUX
voice
(
NULL
),
//
voice(NULL),
#endif
voiceIndex
(
0
),
emergency
(
false
)
...
...
@@ -125,12 +127,13 @@ bool GAudioOutput::say(QString text, int severity)
synth
.
SpeakText
(
"Hello, world!"
);
#endif
#ifdef Q_OS_LINUX
#ifdef Q_OS_LINUX
2
QTemporaryFile
file
;
file
.
setFileTemplate
(
"XXXXXX.wav"
);
if
(
file
.
open
())
{
cst_wave
*
wav
=
flite_text_to_wave
(
text
.
toStdString
().
c_str
(),
this
->
voice
);
cst_voice
*
v
=
register_cmu_us_kal16
(
NULL
);
cst_wave
*
wav
=
flite_text_to_wave
(
text
.
toStdString
().
c_str
(),
v
);
// file.fileName() returns the unique file name
cst_wave_save
(
wav
,
file
.
fileName
().
toStdString
().
c_str
(),
"riff"
);
m_media
->
setCurrentSource
(
Phonon
::
MediaSource
(
file
.
fileName
().
toStdString
().
c_str
()));
...
...
@@ -236,14 +239,14 @@ void GAudioOutput::beep()
void
GAudioOutput
::
selectFemaleVoice
()
{
#ifdef Q_OS_LINUX
this
->
voice
=
register_cmu_us_slt
(
NULL
);
//
this->voice = register_cmu_us_slt(NULL);
#endif
}
void
GAudioOutput
::
selectMaleVoice
()
{
#ifdef Q_OS_LINUX
this
->
voice
=
register_cmu_us_rms
(
NULL
);
//
this->voice = register_cmu_us_rms(NULL);
#endif
}
...
...
@@ -258,7 +261,7 @@ void GAudioOutput::selectNeutralVoice()
QStringList
GAudioOutput
::
listVoices
(
void
)
{
QStringList
l
;
#ifdef Q_OS_LINUX
#ifdef Q_OS_LINUX
2
cst_voice
*
voice
;
const
cst_val
*
v
;
...
...
src/GAudioOutput.h
View file @
0528d871
...
...
@@ -39,7 +39,7 @@ This file is part of the PIXHAWK project
#include <Phonon>
#endif
#ifdef Q_OS_LINUX
#include <flite.h>
#include <flite
/flite
.h>
#include <phonon>
#endif
#ifdef Q_OS_WIN
...
...
@@ -52,6 +52,14 @@ This file is part of the PIXHAWK project
#endif
*/
#ifdef Q_OS_LINUX
extern
"C"
{
cst_voice
*
REGISTER_VOX
(
const
char
*
voxdir
);
void
UNREGISTER_VOX
(
cst_voice
*
vox
);
cst_voice
*
register_cmu_us_kal16
(
const
char
*
voxdir
);
}
#endif
/**
* @brief Audio Output (speech synthesizer and "beep" output)
* This class follows the singleton design pattern
...
...
@@ -93,7 +101,7 @@ protected:
//NSSpeechSynthesizer
#endif
#ifdef Q_OS_LINUX
cst_voice
*
voice
;
///< The flite voice object
//
cst_voice* voice; ///< The flite voice object
#endif
int
voiceIndex
;
///< The index of the flite voice to use (awb, slt, rms)
Phonon
::
MediaObject
*
m_media
;
///< The output object for audio
...
...
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