Posts: 1,505
Threads: 143
Joined: May 2007
Is there anyway to tell when PlayIVWav is finished playing? With the PlayWav command, I can set that so Asynchronous to false, but there isn't a way to do that with the PlayIVWav. Is there another way to do this?
What I am trying to do on the IV is Play a wav file that varies from 2 - 7 seconds, then give a TTS broadcast - i.e. weather forecast. The wav file is some goofy wav file that is randomized to about 12 different wav files, but can have different lengths. Right now I have a Pause set for 7 seconds, but it would be better if the TTS started immediately after the the wav file completed.
Posts: 40,483
Threads: 491
Joined: Aug 2002
There isn't really a way to do that as it stands now. The command is just queued up on the target IV and returns immediately, on the assumption that mostly you'd be wanting to do other things while it plays.
Is there no way to now which length you are going to play?
Dean Roddey
Explorans limites defectum
Posts: 1,505
Threads: 143
Joined: May 2007
That was what I was going to do if there wasn't a way - somehow pass the length of the wav file so the Pause command knows how long to wait.
Posts: 4,225
Threads: 365
Joined: May 2005
I have the same problem with the SayIVText.
I have two commands where I want one to execute after the text has finished being "read" but it fires immediately.
Mykel Koblenz
Illawarra Smart Home
Posts: 1,505
Threads: 143
Joined: May 2007
For the TTS, I use the WaitFieldValue command and it does wait for the text to finish before going to the next one:
Code:
// Speak the Weather and Forecast into the IV
System::SayIVText
P1=%(StdRTV:HostName)
P2=%(LVar:CurrWeather)
Devices::WaitFieldValue
P1=TTS.SpeechActive
P2=False
P3=Equal
P4=30000
System::SayIVText
P1=%(StdRTV:HostName)
P2=%(LVar:Forecast1)
Devices::WaitFieldValue
P1=TTS.SpeechActive
P2=False
P3=Equal
P4=30000
System::SayIVText
P1=%(StdRTV:HostName)
P2=%(LVar:Forecast2)
Posts: 4,225
Threads: 365
Joined: May 2005
Thanks - I'll check it out and see how it goes.
I do find speech queues up fine, but other actions dont so this should fix that issue.
Mykel Koblenz
Illawarra Smart Home
Posts: 40,483
Threads: 491
Joined: Aug 2002
kblagron Wrote:For the TTS, I use the WaitFieldValue command and it does wait for the text to finish before going to the next one:
Hmmm... That shouldn't work. That should only work if you actually queue up text to be spoken on the TTS driver. But there, you are just sending the text to an IV, which should not make the TTS driver's active field change, in which case that wait field value call should return immediately, because it should always be false.
Dean Roddey
Explorans limites defectum
Posts: 1,505
Threads: 143
Joined: May 2007
Not sure why but it does. At first I had them in succession and it did like znelbok's, but since I was using that command in a scheduled trigger for the TTS driver, I tried it as shown, and it now waits.