fixed tts playback in Qt5 (translator)

This commit is contained in:
Luis Ángel San Martín
2013-11-18 21:18:33 +01:00
parent 4006bf6e43
commit 1bb112a848
2 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include <QUrl>
#if QT_VERSION >= 0x050000
#include <QMediaPlayer>
#else
#include <Phonon/MediaObject>
#include <Phonon/MediaSource>
@ -163,6 +164,7 @@ YACReaderTranslator::YACReaderTranslator(QWidget * parent)
//multimedia/phonon
#if QT_VERSION >= 0x050000
player = new QMediaPlayer;
#else
music = createPlayer(MusicCategory);
#endif
@ -291,6 +293,10 @@ void YACReaderTranslator::play()
{
//QMessageBox::question(this,"xxx",ttsSource.toString());
#if QT_VERSION >= 0x050000
player->setMedia(ttsSource);
player->play();
#else
MediaSource src(ttsSource);
src.setAutoDelete(true);