
cafasaru
USA
Asked
— Edited
Hey guys, here is a script I have been working on. It reads the Rss News and after it is done with the first story it asks you if you want to continue. If you say "Yes" it will continue to the second story, and if you say "NO" it will end the script. I didn't know if this was posted already somewhere but I thought I would share it anyways . RSSNEWS.EZB
1. To avoid any errors if the variable isn't defined before any IF or calculations.
2. To reset all variables if a script is stopped then restarted.
3. So I know what the variables are (the amount I use I tend to lose track)
While it may be redundant and makes the script longer I prefer it that way, but that's just my way I guess, each person will do things differently.
Code:
I uploaded it to the cloud too, click here to download
The RSS Feed URL is a variable at the start of the script, this can be changed for any valid RSS feed at the top of the script, just change the url in the quotes. No need to change the script other than that
The script is the only control in the project which should make importing it in to your current ARC project through the merge feature very simple to do.
Code is commented as per usual to help aid you in learning why the commands are there and what they do.
Enjoy
Thank You
Steve S
More is on the way too
Reviving an old thread but this was an interesting one. I have a quick question I hope you can help with.
I tried out your script for the RSS news feed with a ControlCommand() in a speech synthesis control and it worked well (had to add comma's to the url), except for one thing. When the speech synth says "would you like to continue" it then quickly says "ok" before I say anything, and when I do say yes, nothing happens. Any thoughts to remedy this?
Also the script should work fine and wait for 10 seconds for a yes or no response at the line with WaitForSpeech() in it. If it's not then it indicates that it has heard something which resembles "no" or it is timing out hence it saying OK and ending. Check your speech recognition training, your microphone and any speech controls added to the project.
You could change the Else to an ElseIf($response = "NO") and then add a further Else before the EndIf with SayWait("An error has occured"), this would help pinpoint where the issue may lie...
Like this;
Code:
Also note that the project I uploaded to the cloud is not intended to be a stand alone project but one for the script to be merged from or copy and pasted from.
Another note, the forum is adding an extra ; in the feedurl line, it's not needed. Download the project from the cloud and adapt the script from there with the lines mentioned above.
Code:
Code:
Without the commas, it wouldn't work for me and was coming up with an error. With commas added it worked fine (I also took out the ; you mentioned). I did also change the url the BBC news after a few try's which also worked great but still unable to continue.
The speech recognition couldn't have picked anything else up as the room I was in was in complete silence, and when it was saying "ok" it was instantly after it says would you like to continue, no time to hear anything anyway.
I admit that I did run the script as a stand alone with the exception of the speech recognition control, and set a ControlCommand() to start the script control with the phrase "tell me the news" which worked really well. I only did this as a trial before I added it to my main project. I just wondered if the syntax might have changed as this posted a year ago.
Alan
As far as I know WaitForSpeech() isn't broken so I can only assume the premature ending before answering is due to running the script as a stand alone project and not having any speech recognition set up on this PC (or in the project).
I do have speech recognition set up with a good headset and is constantly trained so it may be as you say, running it stand alone. I did also add a "yes" and "no" commands to the speech recognition control config along with "tell me the news".
So with running it stand alone possibly being the cause, can I ask what do you suggest I could run it with (another script or control)? I think the RSS script you came up with is pretty cool and would love to get it fully working.
Cheers.
P.s. @Rich. love the new avatar by the way :P.
Possibly a moot point since you said you wear a headset.... but maybe something to consider...
@Richard, I think it's more a case of it not waiting to hear anything as on a quick test mine went straight to finishing, since it ends with just an Else not ElseIf, anything other than hearing a "Yes" will end it, hence the addition of a few lines of code mentioned previously.
I only tested it on one PC with no VR set up, no mic etc. so it's not hearing itself. I'll have another look later on my HTPC which is what I wrote it on and see if I can figure out the problem.
That's Brilliant. Thanks for looking in to this for me. And a cant wait to see what you have in store later in the month. I really enjoy reading your content and you are a real asset to the community with your help and advice. Great stuff. :D.
@Richard.
Yeah that did cross my mind too, thinking that the headset mic was picking up something. But even with the laptop volume turned right down it had no effect. Good thinking though, and thanks. (Btw, your a great asset too).
I just had a go at trying the script you supplied in post #15, but it's still not waiting for a response after it says "Would you like me to continue?" and immediately says "An error has occurred" and get the following message...
On thing about this script, it no longer needs the brackets needed now. Did you get a chance to see what could be causing the error?
This is going from memory back 18 months to a couple of years but the speech profile needs to be English US not English GB (as I assume you have it set, as do I on the PC I tested it on). Changing the speech profile to English US may solve it however it also means you need to re-train.
I found the RSS jokes in ARC examples, put in BBC's news rss and worked fine, but where and what do I put so while the feed is being read, I can say something like "stop reading" to the voice rec and it does just that? I tried a few different ways but none of them worked. Any ideas?
Cheers.
Stop Audio,
Speak Stop,
Control command scrip stop,
Control command script pause,
and
Control command script start for the RSS stop script control in the RSS jokes example.
Non of which which will execute until the entire RSS feed has been read. The manual stop script control works fine but would love to do this via speech recognition. Still being new at scripting I am out of ideas to how I can achieve this so any ideas would be most welcome.