Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Current Conditions Audio

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderators: daj, TNETWeather

User avatar
PaulMy
Posts: 1548
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Current Conditions Audio

Postby PaulMy » Tue Sep 20, 2016 12:09 am

A little script http://www.komokaweather.com/weather/meteo_audio.html (still a work in progress) borrowed from F1LXJ Serge at Météo d'Annoeullin dans les Hauts-de-France http://f1lxj.fr/weather/index.htm and http://www.meteo-saint-brevin.fr/

Enjoying,
Paul
Last edited by PaulMy on Mon Sep 11, 2017 2:57 pm, edited 2 times in total.

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: For those with poor eyesight

Postby mcrossley » Tue Sep 20, 2016 9:24 am

PaulMy wrote:A little script http://www.komokaweather.com/weather/meteo_audio.html (still a work in progress) borrowed from F1LXJ Serge at Météo d'Annoeullin dans les Hauts-de-France http://f1lxj.free.fr/weather/index.htm and http://www.meteo-saint-brevin.fr/

Enjoying,
Paul

Very good Paul. I think you need to replace the decimal points with the word 'point' though - certainly for UK English is is interpreting the decimal as a full stop and putting a long pause in.
E.g. change "16.3 degrees celsius" to "16 point 3 degrees celsius"

User avatar
PaulMy
Posts: 1548
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: For those with poor eyesight

Postby PaulMy » Wed Sep 21, 2016 1:08 am

Correct Mark, I noticed that for English and I assume it was not a problem with the original French, but how? It is a webtag processed script.

I had not yet shown the French version as the French accented words did not download correctly but got an update from Serge that I will try.

Paul

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: For those with poor eyesight

Postby mcrossley » Wed Sep 21, 2016 8:30 am

If you are creating the 'text' in PHP, then where you use the appropriate tag use a str_replace(). Eg. using made up variables...

Code: Select all

$text = "The temperature is $temp degrees celsius"
to...
$text = 'The temperature is ' . str_replace('.', ' point ', $temp) . ' degrees celsius';


edit: Though the ' point ' string would be better as a variable then you can localise it easily.

User avatar
mlj1
Posts: 63
Joined: Mon Dec 26, 2011 8:14 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 7 SP1
Location: Saint-Brevin les Pins, France
Contact:

Re: For those with poor eyesight

Postby mlj1 » Wed Sep 21, 2016 10:45 am

Hi Paul and everybody,

Thank you for your interrest for our weather audio pages.
After trying poor quality mp3 audio messages generators, I found responsivevoice and tried their API with Serge F1LXJ.

It is by far the best quality audio obtained right now, but our audio pages need the responsivevoice website to be up in order to work, since the script use to call routines on it. We allready got an issue for a few days when their website was down.

Your help will be appreciated to provide us well formated English sentences with the right words. And for the time and data formats as well.
We will follow your work with interrest.

Note the French Female voice is excellent on a Windows PC but a little agressive on Ipad or Iphone.

http://www.meteo-saint-brevin.fr/audio.htm
http://www.meteo-saint-brevin.fr/infos.htm
Best regards,
Marcel
Marcel Le Jeune F6DOW, Saint-Brevin les Pins, Pays de la Loire, France
Davis VP2+, D-Link wifi IP webcam DCS2130
http://www.meteo-saint-brevin.fr
Image

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: For those with poor eyesight

Postby mcrossley » Wed Sep 21, 2016 11:12 am

Paul, there is lots you could around this to make it more 'human' :roll: , for instance...

Code: Select all

if ($sunshine == 0) {
   $text += "There has been no sunshine so far today.\n";
} else {
   $text += "The sun shine so far today is " . str_replace('.', ' point ', $sunshine) . " hours.\n";
}
if ($rainfall == 0) {
   $text += "There has been no rainfall so far today.\n";
} else {
   $text += "The rain so far today is " . str_replace('.', ' point ', $rainfall) . " millimeters.\n";
}

User avatar
mlj1
Posts: 63
Joined: Mon Dec 26, 2011 8:14 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 7 SP1
Location: Saint-Brevin les Pins, France
Contact:

Re: For those with poor eyesight

Postby mlj1 » Wed Sep 21, 2016 11:38 am

Hi Mark,

The problem is the actual script is in html and I don't know how to convert it in PHP to apply the suggestions you gave to Paul.
Best regards


Code: Select all

<body>
<h3><img src='favicon.ico'>&nbsp;M&eacute;t&eacute;o Saint-Brevin - Bulletins audio</h3><hr><br>
<script src="https://code.responsivevoice.org/responsivevoice.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<center>
<img src="images/grundig512.jpg"><br /><br>

<textarea id="text" style="height:1px;display:none;">
Voici les derniers relevés de Météo Saint-Brévin.
Effectués le <#time format="dddd d mmmm"> à <#time format="h'h'nn">.
La température est de <#temp> degrés avec un ressenti de <#apptemp> degrés.
Le taux d'humidité est de <#hum> pour 100.
La pression atmosphérique est de <#press> hecto pascals; et la tendance barométrique est : "<#presstrend>".
Le vent venait du secteur <#currentwdir>. à une vitesse de <#wlatest> kilomètres par heure.
La plus forte rafale du jour était de <#wgustTM> kilomètres par heure, à <#TwgustTM format="h'H'nn">.
La base théorique des nuages se situe, à : <#cloudbase>.
Le nivau de pluie du jour est de <#rfall> millimètres par mètre carré.
Lever du soleil aujourd'hui à <#sunrise format="h'h'n">. Et coucher du soleil à <#sunset format="h'h'n">.
Merci pour votre attention.
Le prochain bulletin sera disponible dans quelques minutes.</textarea>
</textarea>

<textarea id="text1" style="height:1px;display:none;">
Here is the latest weather report from Meteo Saint-Brevin.
Released today at <#time format="h' 'nn">.
Temperature is <#temp>° celsius, feeling like <#apptemp>°.
It was <#temptrendenglish> over the last three hours.
Humidity is <#hum> %.
The atmospheric pressure is <#press> hectopascals;
And barometric pressure trend is : "<#presstrendenglish>" .
The wind is blowing from a bearing of <#bearing>°; with a speed of <#wlatest> Km/h.
And the strongest gust today was <#wgustTM> Km/h at <#TwgustTM format="h' 'nn">.
The theorical cloud base is : <#cloudbase>.
The rain level today is <#rfall> millimeter per square meter.
Actually, the Davis station forecast shows : <#wsforecast>.
Sunrise today at <#sunrise format="h' 'n">, and sunset at <#sunset format="h' 'n">.
Thank you for your attention.
The next report will be available in a few minutes.
</textarea>

<input
  onclick="responsiveVoice.speak($('#text').val(), 'French Female');"
  type="button"
  value="Cliquez ici pour écouter le dernier bulletin de Météo Saint-Brevin"
/>
<p></p>
<input
  onclick="responsiveVoice.speak($('#text1').val(), 'US English Male');"
  type="button"
  value="Click here to listen to the latest report from Météo Saint-Brevin"
/>
</body>
Marcel Le Jeune F6DOW, Saint-Brevin les Pins, Pays de la Loire, France
Davis VP2+, D-Link wifi IP webcam DCS2130
http://www.meteo-saint-brevin.fr
Image

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: For those with poor eyesight

Postby mcrossley » Wed Sep 21, 2016 4:17 pm

Ah, if you don't have PHP then it is a little more complex. You will have to put the variables into some javascript and get that to generate the final text in the clients browser. Something like this (untested - only the English is done, my French isn't that good!)...

Code: Select all

<body>
<h3><img src='favicon.ico'>&nbsp;M&eacute;t&eacute;o Saint-Brevin - Bulletins audio</h3><hr><br>
<script src="https://code.responsivevoice.org/responsivevoice.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<center>
<img src="images/grundig512.jpg"><br /><br>

<textarea id="text" style="height:1px;display:none;">
Voici les derniers relevés de Météo Saint-Brévin.
Effectués le <#time format="dddd d mmmm"> à <#time format="h'h'nn">.
La température est de <#temp> degrés avec un ressenti de <#apptemp> degrés.
Le taux d'humidité est de <#hum> pour 100.
La pression atmosphérique est de <#press> hecto pascals; et la tendance barométrique est : "<#presstrend>".
Le vent venait du secteur <#currentwdir>. à une vitesse de <#wlatest> kilomètres par heure.
La plus forte rafale du jour était de <#wgustTM> kilomètres par heure, à <#TwgustTM format="h'H'nn">.
La base théorique des nuages se situe, à : <#cloudbase>.
Le nivau de pluie du jour est de <#rfall> millimètres par mètre carré.
Lever du soleil aujourd'hui à <#sunrise format="h'h'n">. Et coucher du soleil à <#sunset format="h'h'n">.
Merci pour votre attention.
Le prochain bulletin sera disponible dans quelques minutes.
</textarea>

<textarea id="text1" style="height:1px;display:none;"></textarea>

<input
  onclick="responsiveVoice.speak($('#text').val(), 'French Female');"
  type="button"
  value="Cliquez ici pour écouter le dernier bulletin de Météo Saint-Brevin"
/>
<p></p>
<input
  onclick="responsiveVoice.speak($('#text1').val(), 'US English Male');"
  type="button"
  value="Click here to listen to the latest report from Météo Saint-Brevin"
/>
<script>
var text1 = 'Here is the latest weather report from Meteo Saint-Brevin. Released today at <#time format="h' 'nn">. ';
text1 += 'The temperature is ' + (<#temp> % 1 == 0 ? parseInt(<#temp>) : <#temp>) + '° Celsius, feeling like (<#apptemp> % 1 == 0 ? parseInt(<#apptemp> : <#apptemp>) + '°. ';
text1 += 'The temperature has been <#temptrendenglish> over the last three hours. ';
text1 += 'Humidity is <#hum> %. ';
text1 += 'The atmospheric pressure is <#press> hectopascals; ';
text1 += 'And the pressure trend is <#presstrendenglish>. ';
if (<#wlatest> == 0) {
    text1 += 'The wind is currently calm. ';
} else {
    text1 += 'The wind is blowing from a bearing of <#bearing>°; with a speed of ' + (<#wlatest> % 1 == 0 ? parseInt(<#wlatest>) : <#wlatest>) + ' Km/h. ';
}
text1 += 'And the strongest gust today was ' + (<#wgustTM> % 1 == 0 ? parseInt(<#wgustTM>) : <#wgustTM>) + ' Km/h at <#TwgustTM format="h' 'nn">. ';
text1 += 'The theorical cloud base is : <#cloudbase>. ';
if (<#rfall> == 0) {
    text1 += 'It has not rained so far today. ';
} else {
    text1 += 'The rainfall today is ' + (<#rfall> % 1 == 0 ? parseInt(<#rfall>) : <#rfall>) + ' millimetres. ';
}
text1 += 'The Davis station forecast shows : <#wsforecast>. ';
text1 += 'Sunrise today at <#sunrise format="h' 'n">, and sunset at <#sunset format="h' 'n">. ';'
text1 += 'Thank you for your attention. ';
text1 += 'The next report will be available in a few minutes.';
document.getElementById('text1').innerText = text1;
</script>
</body>

User avatar
mlj1
Posts: 63
Joined: Mon Dec 26, 2011 8:14 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 7 SP1
Location: Saint-Brevin les Pins, France
Contact:

Re: For those with poor eyesight

Postby mlj1 » Wed Sep 21, 2016 4:32 pm

Thank you very much Mark !
I will try that as soon as possible.
Will it be possible in the English part of that script to include some code in form of strreplace to replace the decimal point in a value by the word point (ie 21 point 2 degrees in place of 21.2 degrees) ?
Marcel Le Jeune F6DOW, Saint-Brevin les Pins, Pays de la Loire, France
Davis VP2+, D-Link wifi IP webcam DCS2130
http://www.meteo-saint-brevin.fr
Image

User avatar
mlj1
Posts: 63
Joined: Mon Dec 26, 2011 8:14 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 7 SP1
Location: Saint-Brevin les Pins, France
Contact:

Re: For those with poor eyesight

Postby mlj1 » Wed Sep 21, 2016 5:04 pm

Really sorry Mark !
I copied your script in a test page here
http://www.meteo-saint-brevin.fr/voice/audio.htm
and unfortunately, the button for English message gives no sound.
Could you please have a look and tell me what I did wrong ?
Thank you in advance
Marcel Le Jeune F6DOW, Saint-Brevin les Pins, Pays de la Loire, France
Davis VP2+, D-Link wifi IP webcam DCS2130
http://www.meteo-saint-brevin.fr
Image

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: For those with poor eyesight

Postby mcrossley » Wed Sep 21, 2016 5:10 pm

Hi Marcel, it looks like Cumulus hasn't processed the page - it still has the web tags in it.

I'll look at doing the 'point' stuff...

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: For those with poor eyesight

Postby mcrossley » Wed Sep 21, 2016 5:35 pm

And there was at least one error in the code before, still untested, but looks better to my eye.
Just the script this time...

Code: Select all

var text1 = 'Here is the latest weather report from Meteo Saint-Brevin. Released today at <#time format="h' 'nn">. ';
var english = {};
var point = ' point ';
english.temp = replacePoint(<#temp>, point);
english.apptemp = replacePoint(<#apptemp>, point);
english.wlatest = replacePoint(<#wlatest>, point);
english.wgustTM = replacePoint(<#wgustTM>, point);
english.rfall = replacePoint(<#rfall>, point);

text1 += 'The temperature is ' + english.temp + '° Celsius, feeling like ' + english.apptemp + '°. ';
text1 += 'The temperature has been <#temptrendenglish> over the last three hours. ';
text1 += 'Humidity is <#hum> %. ';
text1 += 'The atmospheric pressure is <#press> hectopascals; ';
text1 += 'And the pressure trend is <#presstrendenglish>. ';
if (<#wlatest> == 0) {
    text1 += 'The wind is currently calm. ';
} else {
    text1 += 'The wind is blowing from a bearing of <#bearing>°; with a speed of ' + english.wlatest + ' Km/h. ';
}
text1 += 'And the strongest gust today was ' + english.wgustTM + ' Km/h at <#TwgustTM format="h' 'nn">. ';
text1 += 'The theorical cloud base is : <#cloudbase>. ';
if (<#rfall> == 0) {
    text1 += 'It has not rained so far today. ';
} else {
    text1 += 'The rainfall today is ' + english.rfall + ' millimetres. ';
}
text1 += 'The Davis station forecast shows : <#wsforecast>. ';
text1 += 'Sunrise today at <#sunrise format="h' 'n">, and sunset at <#sunset format="h' 'n">. ';
text1 += 'Thank you for your attention. ';
text1 += 'The next report will be available in a few minutes.';

document.getElementById('text1').innerText = text1;

function replacePoint(val, str) {
    return (val % 1 === 0 ? parseInt(val) : val).toString().replace('.', str);
}

User avatar
PaulMy
Posts: 1548
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: For those with poor eyesight

Postby PaulMy » Wed Sep 21, 2016 6:00 pm

I wish I could participate in the testing learning but not at home for a few more hours... I will give it a try then.

Paul

User avatar
mlj1
Posts: 63
Joined: Mon Dec 26, 2011 8:14 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 7 SP1
Location: Saint-Brevin les Pins, France
Contact:

Re: For those with poor eyesight

Postby mlj1 » Wed Sep 21, 2016 8:11 pm

Thank you Mike
Sorry for my mistake in a previous script which was not processed by Cumulus. Ooooops !
After correcting the issue, the button did not give the message in English in the loudspeaker.
After insterting your last script, it speaks now.
As you will listen by visiting
http://www.meteo-saint-brevin.fr/audio.htm
the temperatures and maximum gust are truncated.
It does not say 21 point 7 degrees but 21 degrees.
On an other hand, i would appreciate to have the barometric pressure truncated (1013 hPa instead of 1013,47 hPa)
All in your script is new for me and I enjoy learning.
Thanks again
Marcel Le Jeune F6DOW, Saint-Brevin les Pins, Pays de la Loire, France
Davis VP2+, D-Link wifi IP webcam DCS2130
http://www.meteo-saint-brevin.fr
Image

User avatar
Mapantz
Posts: 446
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: For those with poor eyesight

Postby Mapantz » Wed Sep 21, 2016 9:16 pm

Really like this!

The male voice reminds me of the shipping forecast we have in the UK: https://youtu.be/oguCxlZ94Ho?t=119
Image
Image


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 5 guests