Commit 10424af8 authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

voices, added a clearQueue() function on GCAudio

This is called when before we call the start of an activity.

This is called in next/previous level of click on letter to flush
the audio queue.
parent 24a4f121
...@@ -162,6 +162,7 @@ function playLetter(letter) { ...@@ -162,6 +162,7 @@ function playLetter(letter) {
} }
function nextLevel() { function nextLevel() {
items.audioVoices.clearQueue()
if(maxLevel <= ++currentLevel ) { if(maxLevel <= ++currentLevel ) {
currentLevel = 0 currentLevel = 0
} }
...@@ -170,6 +171,7 @@ function nextLevel() { ...@@ -170,6 +171,7 @@ function nextLevel() {
} }
function previousLevel() { function previousLevel() {
items.audioVoices.clearQueue()
if(--currentLevel < 0) { if(--currentLevel < 0) {
currentLevel = maxLevel - 1 currentLevel = maxLevel - 1
} }
......
...@@ -71,6 +71,12 @@ Item { ...@@ -71,6 +71,12 @@ Item {
silenceTimer.interval = duration_ms silenceTimer.interval = duration_ms
} }
function clearQueue() {
while(files.length > 0) {
files.pop();
}
}
function _playNextFile() { function _playNextFile() {
var nextFile = files.shift() var nextFile = files.shift()
if(nextFile) { if(nextFile) {
......
...@@ -87,6 +87,7 @@ Window { ...@@ -87,6 +87,7 @@ Window {
function getTransition(properties) function getTransition(properties)
{ {
properties.exitItem.pause() properties.exitItem.pause()
audioVoices.clearQueue()
if(!properties.exitItem.isDialog) { if(!properties.exitItem.isDialog) {
if(!properties.enterItem.isDialog) { if(!properties.enterItem.isDialog) {
playIntroVoice(properties.enterItem.activityInfo.name) playIntroVoice(properties.enterItem.activityInfo.name)
......
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