Skip to Content
It is currently December 16th, 2019, 5:25 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: July 4th, 2013, 6:02 am 
Offline
Junior User
Junior User

Joined: June 12th, 2008, 8:04 pm
Posts: 55
After weeks of coding, debugging, and testing, it is finally ready to go live. free version 1.0

Weather script system

What does WSS do?
creates a 45-60 second wav file of a voice reading the local weather or any weather station on earth. includes death valley(125F) and Antarctica(-85F) codes for your amusement.
play the wav on sam and have live local weather on your station

I use a commercial voice. you can test this same voice in your setup. a link for it is in the zip package. this is Much better than the free google voice. worth the $35 price should you chose to license it. but you can use any sapi4 of sapi5 voice. the test voice is full version one. not a trial so no restrictions. I am only providing a link. not my file. i will be looking at ava a new voice soon. try nextup.com for comm voices.

cheaper than paying a weather person :mrgreen: ....automatic, you control when.

how does WSS work?
a script you schedule to run on your pc.
Uses the API from Weatherunderground.com
gets the xml data from a station
reads the data
creates a text file (you could read it live of you want)
converts the text file to a wav file using a free speech engine.
you play the file same way you play a song using a pal or event or what ever.

fast too, script takes less than 10 seconds to pull data and create a new updated wav.
this uses the API so is not dependent on any rss feeds or webpage layouts.
fully XML based data stream and microsoft VBS. futureproof.

ver 1.0 includes

custom
-----------
intro and outro phrases
city and area
metorologist name plus

reads, depending on time of day
---------
sky conditions- like clear, partly cloudy, and thunderstorm- not sure about the sky condition "volcanic ash" though. if you hear that one...run away.
temp F
humidity %
wind speed,dir, and gusts mph
feels like temp
air pressure and trend
sunrise sunset to sunrise
UV index 10-4
sunset 4-sunset
dew point 4 to midnight
forcast for the day mornings to 10
forcast for night 3-midnight
forcast for tomorrow 3- midnight



What do i need?
free api key from weather underground, link is in setup
free voice engine software from balabolka, link is in setup
at least one voice installed test voice link is in setup
wget for windows- comes installed in zip but link to install exe in setup.
WSS script in zip package. includes a backup in case you screw it up
setup instructions in zip.

how do i get WSS?
download the zip file, unpack and read the setup file. it explains how to setup and configure. includes download links to everything you need, including a voice file.

how to install? simple
read the setup text file. it tells you how to
download and install voice and engine.
get wu api key.
set your file paths, station id, wu key, city, dj intro and outro.
setup a scheduler job to run WSS every hour.
setup sam to play the wav file when you want the weather on your station.
simple really.

The script has been tested for many things that can go wrong and is very robust. it has error control, debugging, err logging, and data checking. If a station is down it will report nicely to check back later. if a data item is not working it will not include it in the text. tested with a dozen stations.

future plans:
parse "F" from temps in forecast should say degrees (api issue)
record high, and lows, and year set (data set working already)
forecast for days 3 and 4 option(data set working)
external config file.
dj name changing from text file that sam can create.
random outro phrase. change the comments around
Alerts like tornado and thunderstorm.
metric units? if demand
2.0 GUI???

Download ver 1.0
https://www.box.com/s/cczk3o0zazqfhxsslgpr
Sample of sound file created for broadcast
https://www.box.com/s/hcidbycpgnekfkg8t7xd

If you use it please support. i have 100+ hours in it already
paypal donations accepted jmjandebeur@gmail.com
Give it try let me know how its working.


Top
 Profile  
Reply with quote  
PostPosted: July 4th, 2013, 11:33 am 
Offline
Junior User
Junior User

Joined: June 12th, 2008, 8:04 pm
Posts: 55
ver 1.01
tiny fix in config - getxml : remove the -o
you can do this yourself. i have uploaded the fixed version
on some machines save xml as a file (-o) give permission denied :?

ver1.00 dl: 2


Top
 Profile  
Reply with quote  
PostPosted: July 4th, 2013, 1:14 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7889
Location: Aachen (Germany)
Looks interesting. Two suggestions:
Put more structure into your VB code, it looks like you didn't put much thought into the structure and just wrote everything from top down when you needed it.
This makes it harder than neccessary to understand and modify your code.

Also it would be great if you could externalize the text parts, so everyone could easily build their own announcement text and just put some placeholders where the values from your script get inserted.
That has two advantages: #1 Everyone can have their custom announcer with only the parts they are interested in and #2 it could be used to internationalize the script


The code itself looks pretty clean, finally someone who did proper XML and XPATH instead of the typical regex or character counting :D

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: July 4th, 2013, 1:51 pm 
Offline
Junior User
Junior User

Joined: June 12th, 2008, 8:04 pm
Posts: 55
Ver 1.02
Bug fix my bad thought we we past these
UV function missing some code was not working
update options for now
get just script file and replace, but you have to redo all your edits.
https://www.box.com/s/c93t3v3xgjhtscy2einh
1.0 package updated as well
or
easy way
edit script file(open with notepad) and replace just this text
its about about 75% of the way down the page

Code:
Function UVnow()
If UV = "NA" or UV = "-999" or UV = "-9999" or UV = "Unknown" then
  UVnow = " "
Else
   If Hour(Now()) >= 9 and hour(Now()) < 16 then
     UVnow = "The U V index is " & UV & ". "
   Else
     UVnow = " "
   End If 
End If
End Function


fyi: uv is max 16 and 5 is considered high. google it. hopefully listeners will wonder and google too.

mike


Last edited by Mastacheata on July 4th, 2013, 2:14 pm, edited 1 time in total.
forum tags use square brackets not pointy ones


Top
 Profile  
Reply with quote  
PostPosted: July 4th, 2013, 2:40 pm 
Offline
Junior User
Junior User

Joined: June 12th, 2008, 8:04 pm
Posts: 55
Mastacheata wrote:
Looks interesting. Two suggestions:
Put more structure into your VB code, it looks like you didn't put much thought into the structure and just wrote everything from top down when you needed it.
This makes it harder than neccessary to understand and modify your code.

modifications will break it. thats what has taken so long. working out what can go wrong with things from download, missing nodes, error nodes, and a hundred other things i have found over the last 100 HOURS. what looks like a simple line or two usually has another purpose to go along like the location in the file.
Yes it is a top down setup. had to be to debug. notepad is a bitch to code in. have not found a good vbs enviro. line number and syntax checker would have helped.

everything has to happen in order too. And have to check if something went wrong with a section so we don't put a screwed up file out. would rather not go on unless its right. can't have old weather live.

i am also 'old school' programmer

Mastacheata wrote:
Also it would be great if you could externalize the text parts, so everyone could easily build their own announcement text and just put some placeholders where the values from your script get inserted.
That has two advantages: #1 Everyone can have their custom announcer with only the parts they are interested in and #2 it could be used to internationalize the script


plans for something like this, now that i have things working and have a good understanding of wu, xml, and some vbs.

one of the issues with the text is how the voice will read a phrase. i have used spacing and commas to improve the sound. a few spelling errors too.

they can customize their intro and outro, but the weather parts are written so that they connect to each other. they can drop any piece and it will still work. our UV bug was working under that method.

i am looking at how to pull in an external file with vbs. when i get that working will be able to do this. should be able to turn on and off each piece.

you can get other language voices. not sure would need to have it as text. do not know if eng text will convert to say german or if it would even make sense after. maybe somone can redo the words in another language like a pack.

Mastacheata wrote:
The code itself looks pretty clean, finally someone who did proper XML and XPATH instead of the typical regex or character counting :D


thank you sir its my first time reading xml form another program. looked at many others this seems to be the right way. but had a beast of a time learning what happens when things are not perfect in the xml.

going to have to take a break for a while as i have been full time on this. need to get the 720p hd video online. new i7 laptop, cannon hd camera, black magic, and more. football is coming to soon and i am going to be the best station in my state for my high school football coverage.

"volcanic ash" i still can't believe that's a weather condition!

Now that i know how to do this....where can i find some local area news in print....
I have national news, national sports, and local weather. almost there.

Mike


Top
 Profile  
Reply with quote  
PostPosted: July 4th, 2013, 3:26 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7889
Location: Aachen (Germany)
KHEL973 wrote:
Yes it is a top down setup. had to be to debug. notepad is a bitch to code in. have not found a good vbs enviro. line number and syntax checker would have helped.

I would've at least taken Notepad++ or some of the other fancy all-code editors into account.
Since you are doing VB Script, I guess there must be an Express Edition of Visual Studio for that, right? (The full Visual Studio covers all languages by Microsoft, but costs a shitload of money. But the Express Editions always cover just a single language like C# or C++ etc and are free to use)

KHEL973 wrote:
one of the issues with the text is how the voice will read a phrase. i have used spacing and commas to improve the sound. a few spelling errors too.

they can customize their intro and outro, but the weather parts are written so that they connect to each other. they can drop any piece and it will still work. our UV bug was working under that method.

I has something like a template language in mind. There must be libraries/plugins for things like that even in VB.
Example:
Code:
On friday the wheather in {city} will be {condition} with temperatures between {min_temp} and {max_temp} degrees celsius.

Where {city} would be replaced with something like Aachen and condition could be "partly cloudy" and the temp thingys would just be plain numbers.
That way users could build their own template and adjust the wording until the TTS engine correctly pronounces stuff.

KHEL973 wrote:
ou can get other language voices. not sure would need to have it as text. do not know if eng text will convert to say german or if it would even make sense after. maybe somone can redo the words in another language like a pack.

That was what I had in mind. People could make the texts in German, Spanish, French (just to cover the most widespread languages) with a language-specific TTS voice. One could probably even trick the english voice into speaking german when you write things the way they are pronounced instead of the real words.


KHEL973 wrote:
Now that i know how to do this....where can i find some local area news in print....
I have national news, national sports, and local weather. almost there.

If your local newspaper has a website with a newsfeed in RSS/ATOM/RDF for stuff like Google Reader etc. you could easily parse that as well. (all the Newsfeed formats are XML structures as well)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: July 22nd, 2013, 6:03 pm 
Offline
Junior User
Junior User

Joined: June 12th, 2008, 8:04 pm
Posts: 55
so over a dozen downloads so far.....any comments? issues? requests? if you have it working PLEASE let me know what you think.

I have a solution for a "GUI". As it is VBS the only way is to use an HTA web page, which is good. I am learning how to set it up. Should make a nice config/setup system. will get back to this project soon but the streaming video system is top of the list for now.

Big Mike KHEL 97.3


Top
 Profile  
Reply with quote  
PostPosted: August 27th, 2013, 5:26 pm 
Offline
New User
New User

Joined: August 26th, 2013, 11:43 pm
Posts: 2
WOW, I got this working...sort of, the VB script runs, but Jennifer tells me "there was an error getting the weather data, check back next update." Now is this a code error. or is it an API error on that weather site??
thanks, this should be what I'm looking for....much appreciated
PS: heres modded code, don't see where I could have messed it up

Code:

StationCode = "KLYH"

'paths to your files             

XMLPath = "C:\Users\Hw00d\Desktop\Weather\"

' copy the above path it will save time to cut and paste below

' edit path to run balabolka.exe - edit path to weathertext and weatherwav
' careful not change the double quotes or spacing this is all one line

Balabolka = """C:\Program Files (x86)\Balabolka\balabolka.exe"" -msq ""C:\Users\Hw00d\Desktop\Weather\weather.txt"" ""C:\Users\Hw00d\Desktop

\Weather\weather.wav"" Jennifer r80 p100"

' edit path to wget.exe,
' insert YOUR wu key and stationcode you set above- http://api/{your wu key}//////q/{stationcode}.xml
' edit path again for folder to save xml file too
' careful not change the double quotes or spacing this is all one line

getxml = """C:\Users\Hw00d\Desktop\Weather\"" ""http://api.wunderground.com/api/0MYKEYCODEb/almanac/astronomy/conditions/forecast/q/KLYH.xml""

 C:\Users\Hw00d\Desktop\Weather\"


Top
 Profile  
Reply with quote  
PostPosted: August 27th, 2013, 7:26 pm 
Offline
New User
New User

Joined: August 26th, 2013, 11:43 pm
Posts: 2
just found the log file, its says I have a "Problem 3".....if that helps, thanks ;)


Top
 Profile  
Reply with quote  
PostPosted: September 7th, 2013, 2:39 pm 
Offline
Junior User
Junior User

Joined: June 12th, 2008, 8:04 pm
Posts: 55
sorry i have not been here but the work i have done all summer was live last night for 3 hours . A huge success and i will share some results in another post.

I will try to get back to this system in the next few weeks and get my ideas and changes in. will add some more error checking code to help in this area.


try the following and let me know.

problem 3 is a read xml file error
set debug = 1, it right after the config and todo list, it is 0 now.
click menu > file > save
run the script(double click it)
it should download klyh.xml and rename it to data.xml
it will pop up err number and description , note that and post here
look in tagvalues, a text log file created by debug, see what it reads from the xml
it will help see what it is choking on
should show xml tags and value pairs.
let me know if it good data

watch the folder as you run the script. it should erase the wav, txt and xml files then create new ones as you watch.
click the xml file, it will open in the browser and you should see the data set.
if it is good then it is not problem 2 (but we know that)
this will confirm you are getting the correct data and not a bad xml file or error file.
should look like this, but a lot more

<response>
<version>0.1</version>
<termsofService>http://www.wunderground.com/weather/api/d/terms.html</termsofService>
- <features>
<feature>almanac</feature>
<feature>astronomy</feature>
<feature>conditions</feature>
<feature>hourly</feature>
<feature>forecast</feature>
</features>
- <current_observation>
- <image>
<url>http://icons-ak.wxug.com/graphics/wu2/logo_130x80.png</url>
<title>Weather Underground</title>
<link>http://www.wunderground.com</link>
</image>
- <display_location>
<full>Lynchburg Regional-Glenn, VA</full>
<city>Lynchburg Regional-Glenn</city>
<state>VA</state>
<state_name>Virginia</state_name>
<country>US</country>
<country_iso3166>US</country_iso3166>
<zip>24502</zip>
<magic>5</magic>
<wmo>99999</wmo>
<latitude>37.32666779</latitude>
<longitude>-79.20027924</longitude>
<elevation>285.00000000</elevation>
</display_location>
- <observation_location>
<full>Lynchburg, Virginia</full>
<city>Lynchburg</city>
<state>Virginia</state>
<country>US</country>
<country_iso3166>US</country_iso3166>
<latitude>37.33000183</latitude>
<longitude>-79.19999695</longitude>
<elevation>935 ft</elevation>
</observation_location>
<estimated />
<station_id>KLYH</station_id>


if you have a good xml file the look at the data pairs.
it is the sub readtags where it is getting an error
look at the sub and see if all the tags are in the tagvalues file

post the xml file if you need
mike


Top
 Profile  
Reply with quote  
PostPosted: September 7th, 2013, 3:02 pm 
Offline
Junior User
Junior User

Joined: June 12th, 2008, 8:04 pm
Posts: 55
wow 34 downloads so far

please post your sucess if you have this running.

also the company that posted the link to the Jenn voice had some other us voice links posted. Samantha, Jill ,and Tom.

they have 27 different languages so this expands the use of my script

link to their webpage.

<url>http://www.freedomscientific.com/downloads/RealSpeak-Solo-Direct-Voices/RealSpeak-Solo-Direct-Downloads.asp</url>

they say that the voices are free.

these are the same voices that some companies are selling.
a few of them say they are their voice and want double what others charge.
not sure who to belive but i think they are free as they are older realspeak voices.

mike


Top
 Profile  
Reply with quote  
PostPosted: September 28th, 2013, 3:39 am 
Offline
New User
New User

Joined: September 28th, 2013, 3:36 am
Posts: 3
This is what I am getting in the xml

<?xml version="1.0"?>
-<response><version>0.1</version><termsofService>http://www.wunderground.com/weather/api/d/terms.html</termsofService>-<features>
<feature>almanac</feature>
<feature>astronomy</feature>
<feature>conditions</feature>
<feature>forecast</feature>
</features>-<error><type>querynotfound</type><description>No cities match your search query</description></error></response>

Any ideas?


Top
 Profile  
Reply with quote  
PostPosted: September 30th, 2013, 9:33 am 
Offline
Junior User
Junior User

Joined: June 12th, 2008, 8:04 pm
Posts: 55
check your station code(Klyh) and key(you did get one right) that you put in the <getxml=> config line

you can copy the url in the double quotes and paste into browser and it should return the xml file on screen.
http://api.wunderground.com/api/**your key here*/almanac/astronomy/conditions/forecast/q/Klyh.xml

mike j


works under my key..

cut
</estimated><station_id>KLYH</station_id><observation_time>Last Updated on September 30, 9:54 AM EDT</observation_time><observation_time_rfc822>Mon, 30 Sep 2013 09:54:00 -0400</observation_time_rfc822><observation_epoch>1380549240</observation_epoch><local_time_rfc822>Mon, 30 Sep 2013 10:29:53 -0400</local_time_rfc822><local_epoch>1380551393</local_epoch><local_tz_short>EDT</local_tz_short><local_tz_long>America/New_York</local_tz_long><local_tz_offset>-0400</local_tz_offset><weather>Partly Cloudy</weather><temperature_string>64 F (18 C)</temperature_string><temp_f>64</temp_f><temp_c>18</temp_c><relative_humidity>70%</relative_humidity><wind_string>From the SSW at 4 MPH</wind_string><wind_dir>SSW</wind_dir><wind_degrees>210</wind_degrees><wind_mph>4</wind_mph><wind_gust_mph>0</wind_gust_mph><wind_kph>6</wind_kph><wind_gust_kph>0</wind_gust_kph><pressure_mb>1020</pressure_mb>


Top
 Profile  
Reply with quote  
PostPosted: October 1st, 2013, 4:36 am 
Offline
New User
New User

Joined: September 28th, 2013, 3:36 am
Posts: 3
I will try that, thanks


Top
 Profile  
Reply with quote  
PostPosted: December 12th, 2013, 5:15 pm 
Offline
Junior User
Junior User

Joined: June 12th, 2008, 8:04 pm
Posts: 55
confirmed three us voices on the link above are free even for use in demo packages.

still very busy but will get back to improvements and new features soon.

have an idea for a virtual dj that will use this setup. will work on it too.

good history running it here. very solid, any issues have been with other programs or pc related. the script is solid.

65 downloads so far wow, thanks for looking. maybe i should start a list server for updates and help.
big mike
khel973


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group