diff --git a/src/definitions/definitions.h.in b/src/definitions/definitions.h.in index d8de778..2171ecc 100755 --- a/src/definitions/definitions.h.in +++ b/src/definitions/definitions.h.in @@ -73,7 +73,8 @@ #define CERTIFICATE_PATH "certificate.pem" #define KEY_PATH "key.pk8" //#define TTS_SERVICE_URL "http://translate.google.com/translate_tts?tl=en&q=%1" -#define TTS_SERVICE_URL "http://mary.dfki.de:59125/process?INPUT_TEXT=%1&INPUT_TYPE=TEXT&OUTPUT_TYPE=AUDIO&AUDIO=WAVE_FILE&LOCALE=en_US" +//#define TTS_SERVICE_URL "http://mary.dfki.de:59125/process?INPUT_TEXT=%1&INPUT_TYPE=TEXT&OUTPUT_TYPE=AUDIO&AUDIO=WAVE_FILE&LOCALE=en_US" +#define TTS_SERVICE_URL "http://tts-api.com/tts.mp3?q=%1" #define STORE_API_KEY "BuildmLearnToolkit" #define STORE_ENDPOINT "http://croozeus.com/buildmlearn/api/v1/storeAPI.php" diff --git a/src/miscellaneous/iofactory.cpp b/src/miscellaneous/iofactory.cpp index 57821e3..d07c77d 100755 --- a/src/miscellaneous/iofactory.cpp +++ b/src/miscellaneous/iofactory.cpp @@ -35,10 +35,11 @@ #include #include #include - +#include + #if !defined(Q_OS_OS2) #if QT_VERSION >= 0x050000 -#include +#include #else #include #include @@ -51,7 +52,10 @@ IOFactory::IOFactory() { void IOFactory::playWaveFile(const QString &file_path) { #if QT_VERSION >= 0x050000 - QSound::play(file_path); + QMediaPlayer *player = new QMediaPlayer(); + player->setMedia(QUrl::fromLocalFile(file_path)); + player->setVolume(100); + player->play(); #elif !defined(Q_OS_OS2) Phonon::AudioOutput *out = new Phonon::AudioOutput(Phonon::MusicCategory, qApp); out->setVolume(100.0f); diff --git a/src/templates/learnspellings/learnspellingssimulator.cpp b/src/templates/learnspellings/learnspellingssimulator.cpp index 183fbe2..f525c73 100755 --- a/src/templates/learnspellings/learnspellingssimulator.cpp +++ b/src/templates/learnspellings/learnspellingssimulator.cpp @@ -160,7 +160,7 @@ void LearnSpellingsSimulator::playWord() { // Store downloaded sound file. QString sound_file_name = qApp->templateManager()->tempDirectory() + QDir::separator() + - "sound_" + QDateTime::currentDateTime().toString("yyyy-MM-dd-hhmmss") + ".wav"; + "sound_" + QDateTime::currentDateTime().toString("yyyy-MM-dd-hhmmss") + ".mp3"; QFile sound_file(sound_file_name); sound_file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Unbuffered); sound_file.write(output);