mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 13:45:10 -05:00
Fix "Test TTS" button not working.
Make sure the temporary file doesn't get destroyed before it has been played. Fixes the "Test TTS" button not giving a test playback anymore for TTS systems that cannot do the playback themselves. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29760 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
88e68ec5b0
commit
4d25fb8fe1
1 changed files with 3 additions and 2 deletions
|
|
@ -754,8 +754,9 @@ void Config::testTts()
|
||||||
}
|
}
|
||||||
|
|
||||||
QString filename;
|
QString filename;
|
||||||
|
QTemporaryFile file(this);
|
||||||
|
// keep filename empty if the TTS can do speaking for itself.
|
||||||
if(!(tts->capabilities() & TTSBase::CanSpeak)) {
|
if(!(tts->capabilities() & TTSBase::CanSpeak)) {
|
||||||
QTemporaryFile file(this);
|
|
||||||
file.open();
|
file.open();
|
||||||
filename = file.fileName();
|
filename = file.fileName();
|
||||||
file.close();
|
file.close();
|
||||||
|
|
@ -771,7 +772,7 @@ void Config::testTts()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tts->stop();
|
tts->stop();
|
||||||
if(!(tts->capabilities() & TTSBase::CanSpeak)) {
|
if(!filename.isEmpty()) {
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
QString exe = Utils::findExecutable("aplay");
|
QString exe = Utils::findExecutable("aplay");
|
||||||
if(exe == "") exe = Utils::findExecutable("play");
|
if(exe == "") exe = Utils::findExecutable("play");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue