+1
Answered

Same scene with many audios with sayAudio()

gianfranco de villa 12 years ago updated by Gil 12 years ago 8
Hi,
today I have tried to use the sayAudio() function to call many audios on same scene.

My code:
....

Audios are dinamically created (with mngCreateTTSAudio) and registered (I see them into my list audio).

When loaded the scene, I hear only the scene loaded and not audios in singAsong (22201153_395_Nome, 22201154_395_Zodiaco,...).

Why ?
Where I am wrong ?

Thank you
Gianfranco

Answer

Gianfranco -

The code seems to be missing from your post. I'm guessing it was automatically stripped.

Can you post a link to the page where we can see the problem? This will allow us to review the code as well.

Regards
Gil
SitePal Team
The code stripped is this:

function vh_sceneLoaded(){
singAsong();
}
function vh_talkStarted(){
}
function vh_talkEnded(){
}
function vh_audioProgress(percentPlayed){
}
function restart() {
window.location.reload(false);
}

function singAsong(){

sayAudio('22201153_395_Nome');
sayAudio('22201154_395_Zodiaco');
sayAudio('22201155_395_Responso');
sayAudio('22201156_395_Saluto');

}

To test my page, this is the address to use:

http://173.248.136.115:35813/request_...&

TIA
Gianfranco
Gianfranco -
I looked at your page. Only the last audio seems to be played, and the first 3 audios are ignored.

I'm thinking this is due to interrupt mode being set.
Not sure why it is set - default should be '0'....

what is likely happening is -
the first audio starts playing, but is immediately interrupted by the second audio, which is in turn immediately interrupted by the third & then the fourth.
So we only hear the 4th audio.

Please call setStatus(0,0,0) - before the first call to sayAudio - and let me know if that worked.

Gil
Gil,
I have changed code inserting setStatus(0,0,0) but nothing has changed.

My new code:

function vh_sceneLoaded(){
setstatus(0,0,0);
singAsong();
}
...

function singAsong(){
setstatus(0,0,0);

sayAudio('Test_401_Nome');
sayAudio('Test_401_Zodiaco');
sayAudio('Test_401_Responso');
sayAudio('Test_401_Saluto');

}
So also I have tried to generate audios without sceneID parameter, but again it is not working.

If can help : the audios are created dinamically and the voice of audios is not the same of the scene.

I have no idea how to solve this issue: with one big audio I overcome the 900 chars text limit. The only solution that I have found is use sayAudio().
Some ideas ?

Thanks for your help.

Gianfranco.
Gil,
I have done some tests.

With setstatus() function nothing is working.
With this code:

function vh_sceneLoaded(){
singAsong();
}
function singAsong(){
sayAudio('IT_ThankYou');
sayAudio('IT_Presentation');
sayAudio('EN_Thankyou');
sayAudio('IT_Thankyou');
}
all works fine.

Audios called in this code are audios "fixed" and not created dinamically (note also that audios have different voices - 3 italian and 1 english).
May be some cache problem ?

Gianfranco
Gianfranco -

I'm glad this is working now.
I tried to recreate the problem using audios from your account and I could not recreate - it works fine for me.

here is my test implementation -
http://www.workboy.com/eileen/sayAudi...

As noted - it should not have been necessary to use "setStatus" to set "interrupt mode" to zero - because "interrupt mode" default state is off. So the fact that doing so did not make a difference is not a problem.

As for the reason for the original problem you experienced - this remains unclear.
If you still see any problem let me know and I will look into again.
Best
Gil
Gil,

What I meant in my last message was that the function sayAudio() is working with audios registered from some time, while with audio created "just in time" is not working.
I have not experimented how much time is necessary before sayAudio() is working, but I think that it's too much for my app.

However, reading better, sayAudio function does not work with mobile, so for me it is unusable.

Thanks anyway for your help.

Gianfranco.
Got it. Audios added to the account should be available immediately (as soon as the upload or audio creation is complete). We'll look into it.
Gil