Page 1 of 1
Simple text to speak via browser
Posted: Wednesday 15 November 2017 16:00
by DewGew
This is a simple text to speak using Speech Synthesis API to make your browser speak. I had to use the variables onCalled and offCalled for the speak to run once else it starts over again and again and....maybe someone have simpler way to do this.
Put this codes in custom.js:
Speech function:
Code: Select all
// Speech function
function speak(textToSpeak) {
var newUtterance = new SpeechSynthesisUtterance();
newUtterance.text = textToSpeak;
newUtterance.lang = 'en-GB'; // change to your langage if its supported (nl-NL, en-GB, de-DE, etc)
window.speechSynthesis.speak(newUtterance);
}
Device:
Code: Select all
// Devices that run speak function
// change 136 to your idx
var onCalled_136 = false
var offCalled_136 = false
function getStatus_136(idx,value,device){
if(device['Data']=='On'){
offCalled_136 = false
if(!onCalled_136){
speak('Device is on');
onCalled_136 = true
}
}
else{
onCalled_136 = false
if(!offCalled_136){
speak('Device is off');
offCalled_136 = true
}
}
}
Dashticz - Function - Playsound/Speak
Posted: Thursday 16 November 2017 10:40
by DewGew
New functions for playsound and speak is added in
latest Beta.
Speak works only in english female voice at the moment.
How to use:
Code: Select all
blocks[123]['playsoundOn'] = 'sounds/airplane.mp3'; //only when turn on
blocks[123]['playsoundOff'] = 'sounds/ping.mp3'; //only when turn off
Code: Select all
blocks[123]['speakOn'] = 'Device is on';
blocks[123]['speakOff'] = 'Device is off';
Code: Select all
blocks[123]['playsound'] = 'sounds/button_click.mp3' //toggle
blocks[123]['speak'] = 'Device has toggled';
Re: Simple text to speak via browser
Posted: Thursday 16 November 2017 11:03
by DewGew
This fuction is now added to latest beta read at this topic:
viewtopic.php?f=67&t=20426
Re: Dashticz - Function - playsound/speak
Posted: Thursday 16 November 2017 18:38
by robgeerts
Works great, in addition:
Remove 'speak' and 'playsound' when you are also using 'speakOn'/'speakOff' and 'playsoundOn'/'playsoundOff'
Re: Dashticz - Function - Playsound/Speak
Posted: Monday 20 November 2017 14:57
by gielie
Nice work only i can't get the sound to work on my iPad, on my mac it works great tho.
Re: Dashticz - Function - Playsound/Speak
Posted: Thursday 10 May 2018 13:24
by Vomera
Hi,
I’m using dashticz on my android tablet (Samsung tab a).
When I open dashticz on the Samsung browser I can get sounds when I change a button. Device is turned on or off. But when I use fully kiosk browser it doesn’t work. Is this a bug in dashticz or the fully kiosk browser? How can I solve the problem?
edit: speak function doesnt work, mp3 sounds works
Re: Dashticz - Function - Playsound/Speak
Posted: Thursday 10 May 2018 14:07
by mAiden88
I got little bit the same issue.. On my desktop it works perfect, on my ipad i dont get any sound or speak.
Re: Dashticz - Function - Playsound/Speak
Posted: Friday 11 May 2018 13:11
by Vomera
mAiden88 wrote: Thursday 10 May 2018 14:07
I got little bit the same issue.. On my desktop it works perfect, on my ipad i dont get any sound or speak.
Also on other browsers ?
Re: Dashticz - Function - Playsound/Speak
Posted: Friday 11 May 2018 13:14
by mAiden88
Vomera wrote: Friday 11 May 2018 13:11
mAiden88 wrote: Thursday 10 May 2018 14:07
I got little bit the same issue.. On my desktop it works perfect, on my ipad i dont get any sound or speak.
Also on other browsers ?
I try:
Safari
Chrome
Firefox
On My Windows desktop i use Chrome.
Re: Dashticz - Function - Playsound/Speak
Posted: Friday 11 May 2018 13:31
by Vomera
At the moment i use only the mp3 options, as workaround that works for me.
I tried it on my iphone on safari, it works.
Is your sound turned on ?
Volume up to 100%?
Do not disturb off ?
What ios version do you have ?
Re: Dashticz - Function - Playsound/Speak
Posted: Friday 11 May 2018 18:32
by mAiden88
Vomera wrote: Friday 11 May 2018 13:31
At the moment i use only the mp3 options, as workaround that works for me.
I tried it on my iphone on safari, it works.
Is your sound turned on ?
Volume up to 100%?
Do not disturb off ?
What ios version do you have ?
Let me introduce myself first .. I am certificated in ICT.
Now follow an education to application developer
Yes my sound are on and on 100%.
Do not disturb off is not set.
I have iOS version 11.3
Re: Dashticz - Function - Playsound/Speak
Posted: Sunday 13 May 2018 13:52
by Vomera
Tnx for the introduction so then you know what you are doing

Correction i tried it again on iphone and ipad and it doesnt work anymore :/ strange.
when i switch a button with sound on my iphone the samsung tablet works fine but iphone will not respond.
(i have a samsung tablet on my wall)
Re: Dashticz - Function - Playsound/Speak
Posted: Monday 04 June 2018 15:04
by gielie
It is a iOs problem i think, Rob doesnt have a iOs device so he cant test it.
Re: Dashticz - Function - Playsound/Speak
Posted: Wednesday 06 March 2019 17:49
by zodracom
Vomera wrote: Thursday 10 May 2018 13:24
Hi,
I’m using dashticz on my android tablet (Samsung tab a).
When I open dashticz on the Samsung browser I can get sounds when I change a button. Device is turned on or off. But when I use fully kiosk browser it doesn’t work. Is this a bug in dashticz or the fully kiosk browser? How can I solve the problem?
edit: speak function doesnt work, mp3 sounds works
someone has the solution allready? have the same problem

Re: Dashticz - Function - Playsound/Speak
Posted: Monday 11 March 2019 22:32
by robgeerts
zodracom wrote: Wednesday 06 March 2019 17:49
Vomera wrote: Thursday 10 May 2018 13:24
Hi,
I’m using dashticz on my android tablet (Samsung tab a).
When I open dashticz on the Samsung browser I can get sounds when I change a button. Device is turned on or off. But when I use fully kiosk browser it doesn’t work. Is this a bug in dashticz or the fully kiosk browser? How can I solve the problem?
edit: speak function doesnt work, mp3 sounds works
someone has the solution allready? have the same problem
Its a known problem with Kiosk for a long time..
Cant you use chrome for this? (I thought only benefit was fullscreen mode but its possible inside Dashticz now? Or am i missing something?)
Re: Dashticz - Function - Playsound/Speak
Posted: Tuesday 12 March 2019 15:37
by Vomera
robgeerts wrote: Monday 11 March 2019 22:32
zodracom wrote: Wednesday 06 March 2019 17:49
Vomera wrote: Thursday 10 May 2018 13:24
Hi,
I’m using dashticz on my android tablet (Samsung tab a).
When I open dashticz on the Samsung browser I can get sounds when I change a button. Device is turned on or off. But when I use fully kiosk browser it doesn’t work. Is this a bug in dashticz or the fully kiosk browser? How can I solve the problem?
edit: speak function doesnt work, mp3 sounds works
someone has the solution allready? have the same problem
Its a known problem with Kiosk for a long time..
Cant you use chrome for this? (I thought only benefit was fullscreen mode but its possible inside Dashticz now? Or am i missing something?)
I will check this when i'm home. Didnt know there is a full screen mode in dashticz now! I miss that part!
Re: Dashticz - Function - Playsound/Speak
Posted: Saturday 31 October 2020 16:49
by madpatrick
Hi,
When ik try to add the script to custom.js, it is not working in my tablet with Fully Remote
On my pc i can hear the message playing.
On the tablet I see the following error
Code: Select all
Error : SpeechsynthesisUtterance is not deficed Check function getStatus_262 in custom.js line 2206:22
This is the part of custom.js for block 262
Code: Select all
function getStatus_262(block) {
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
if (parseFloat(Data) < 1.5) {
trigger_262 = true;
block.addClass = 'warning'; // set the addClass parameter for block 262
speak('Alarm is is triggered');
}
else {
trigger_262 = false;
block.addClass = ''; // reset the addClass parameter for block 262
}
handleRegen();