Browse Source

Merge pull request #417 from thomasgubler/linux_text2speech

re-enable linux text to speech and fix use of deprecated function
QGC4.4
Lorenz Meier 12 years ago
parent
commit
bd2da1d28b
  1. 10
      src/GAudioOutput.cc

10
src/GAudioOutput.cc

@ -131,9 +131,9 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent), @@ -131,9 +131,9 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent),
#endif
// Initialize audio output
//m_media = new Phonon::MediaObject(this);
//Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
//createPath(m_media, audioOutput);
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();
@ -223,8 +223,8 @@ bool GAudioOutput::say(QString text, int severity) @@ -223,8 +223,8 @@ bool GAudioOutput::say(QString text, int severity)
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()));
//m_media->play();
m_media->setCurrentSource(Phonon::MediaSource(QUrl::fromLocalFile(file.fileName().toStdString().c_str())));
m_media->play();
res = true;
}

Loading…
Cancel
Save