Commit d07f13d6 authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

click on letter, play the voice letter in sync

Now we trig the play of the voice letter after the completion of the
message 'click on letter'. Before there was a fixed 1500ms but the
message is of variable length depending on the locale.

Extended GCAudio with the signals Error and Done.
parent a27f1aaf
......@@ -232,6 +232,9 @@ ActivityBase {
GCAudio {
id: nextLevelAudio
source: ApplicationInfo.getAudioFilePath("voices/$LOCALE/misc/click_on_letter.ogg")
onError: letterAudio.play()
// When this sound is complete, play the letter
onDone: letterAudio.playDelayed(100);
}
GCAudio {
......
......@@ -153,7 +153,6 @@ function initLevel() {
items.questionItem.visible = false;
items.letterAudio.source = GCompris.ApplicationInfo.getAudioFilePath("voices/$LOCALE/alphabet/"
+ Core.getSoundFilenamForChar(currentLetter));
items.letterAudio.playDelayed(1500);
} else {
// no sound -> show question
items.questionItem.visible = true;
......
......@@ -11,6 +11,7 @@ Item {
property bool autoPlay
signal error
signal done
function play() {
if(!muted) {
......@@ -30,5 +31,6 @@ Item {
console.log("error while playing: " + source + ": " + errorString)
gcaudio.error()
}
onStopped: gcaudio.done()
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment