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
1d5a31d3
Commit
1d5a31d3
authored
Apr 12, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up directory structure, re-enabled Linux audio output
parent
8c28176e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
52 deletions
+40
-52
.gitignore
.gitignore
+1
-1
qgroundcontrol.pri
qgroundcontrol.pri
+4
-7
qgroundcontrol.pro
qgroundcontrol.pro
+0
-0
GAudioOutput.cc
src/GAudioOutput.cc
+31
-42
GAudioOutput.h
src/GAudioOutput.h
+4
-2
No files found.
.gitignore
View file @
1d5a31d3
...
...
@@ -16,4 +16,4 @@ tmp
debug
release
qgroundcontrol.xcodeproj/**
qgroundcontrol
qgroundcontrol
T*.wav
...
...
mavground
.pri
→
qgroundcontrol
.pri
View file @
1d5a31d3
...
...
@@ -40,11 +40,6 @@ OBJECTS_DIR = $$BUILDDIR/obj
MOC_DIR = $$BUILDDIR/moc
UI_HEADERS_DIR = src/ui/generated
# Add external libraries
INCLUDEPATH += $$BASEDIR/lib/flite/include \
$$BASEDIR/lib/flite/lang
#$$BASEDIR/lib/qextserialport/include
# $$BASEDIR/lib/openjaus/libjaus/include \
# $$BASEDIR/lib/openjaus/libopenJaus/include
...
...
@@ -99,7 +94,10 @@ linux-g++ {
release {
DESTDIR = $$BASEDIR
}
INCLUDEPATH += /usr/include
INCLUDEPATH += /usr/include \
$$BASEDIR/lib/flite/include \
$$BASEDIR/lib/flite/lang
HARDWARE_PLATFORM = $$system(uname -a)
contains( HARDWARE_PLATFORM, x86_64 ) {
...
...
@@ -114,7 +112,6 @@ linux-g++ {
message(Building for GNU/Linux 32bit/i386)
}
LIBS += -lm \
-lflite_cmu_us_awb \
-lflite_cmu_us_rms \
-lflite_cmu_us_slt \
-lflite_usenglish \
...
...
mavground
.pro
→
qgroundcontrol
.pro
View file @
1d5a31d3
File moved
src/GAudioOutput.cc
View file @
1d5a31d3
...
...
@@ -48,13 +48,13 @@ using System.Speech.Synthesis;
#ifdef Q_OS_LINUX
extern
"C"
{
#include <flite.h>
#include <cmu_us_awb/voxdefs.h>
#include <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_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
);
...
...
@@ -91,9 +91,12 @@ emergency(false)
#ifdef Q_OS_LINUX
flite_init
();
#endif
// Initialize audio output
m_media
=
new
Phonon
::
MediaObject
(
this
);
Phonon
::
AudioOutput
*
audioOutput
=
new
Phonon
::
AudioOutput
(
Phonon
::
MusicCategory
,
this
);
createPath
(
m_media
,
audioOutput
);
// Prepare regular emergency signal, will be fired off on calling startEmergency()
emergencyTimer
=
new
QTimer
();
connect
(
emergencyTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
beep
()));
...
...
@@ -102,11 +105,8 @@ emergency(false)
case
0
:
selectFemaleVoice
();
break
;
case
1
:
selectMaleVoice
();
break
;
default:
select
Neutral
Voice
();
select
Male
Voice
();
break
;
}
}
...
...
@@ -132,7 +132,6 @@ bool GAudioOutput::say(QString text, int severity)
// 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
()));
qDebug
()
<<
"TYPE:"
<<
m_media
->
currentSource
().
type
();
m_media
->
play
();
qDebug
()
<<
"Synthesized: "
<<
text
<<
", tmp file:"
<<
file
.
fileName
().
toStdString
().
c_str
();
res
=
true
;
...
...
@@ -149,10 +148,6 @@ bool GAudioOutput::say(QString text, int severity)
SpeakString
(
str2
);
qDebug
()
<<
"Synthesized: "
<<
text
.
toAscii
();
#endif
#ifdef Q_OS_WIN32
qDebug
()
<<
"Synthesized: "
<<
text
<<
", NO OUTPUT SUPPORT ON WINDOWS!"
;
#endif
}
return
res
;
}
...
...
@@ -227,52 +222,46 @@ 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
}
/*
void GAudioOutput::selectNeutralVoice()
{
#ifdef Q_OS_LINUX
//
this->voice = register_cmu_us_awb(NULL);
this->voice = register_cmu_us_awb(NULL);
#endif
}
}
*/
#ifdef __cplusplus
extern
"C"
{
#endif
/* __cplusplus */
QStringList
GAudioOutput
::
listVoices
(
void
)
{
QStringList
l
;
QStringList
GAudioOutput
::
listVoices
(
void
)
{
QStringList
l
;
#ifdef Q_OS_LINUX
cst_voice
*
voice
;
const
cst_val
*
v
;
cst_voice
*
voice
;
const
cst_val
*
v
;
/*
printf("Voices available: ");
for (v=flite_voice_list; v; v=val_cdr(v))
{
voice = val_voice(val_car(v));
QString s;
s.sprintf("%s",voice->name);
printf("%s",voice->name);
l.append(s);
}
printf("\n");
*/
#endif
return
l
;
printf
(
"Voices available: "
);
for
(
v
=
flite_voice_list
;
v
;
v
=
val_cdr
(
v
))
{
voice
=
val_voice
(
val_car
(
v
));
QString
s
;
s
.
sprintf
(
"%s"
,
voice
->
name
);
printf
(
"%s"
,
voice
->
name
);
l
.
append
(
s
);
}
#ifdef __cplusplus
printf
(
"
\n
"
);
#endif
return
l
;
}
#endif
/* __cplusplus */
src/GAudioOutput.h
View file @
1d5a31d3
...
...
@@ -65,6 +65,10 @@ public:
static
GAudioOutput
*
instance
();
/** @brief List available voices */
QStringList
listVoices
(
void
);
enum
{
VOICE_MALE
=
0
,
VOICE_FEMALE
}
QGVoice
;
public
slots
:
/** @brief Say this text if current output priority matches */
...
...
@@ -79,8 +83,6 @@ public slots:
void
selectFemaleVoice
();
/** @brief Select male voice */
void
selectMaleVoice
();
/** @brief Select neutral voice */
void
selectNeutralVoice
();
/** @brief Play emergency sound */
void
beep
();
...
...
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