Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #27150 > unrolled thread

Forced to browser-sniff Safari version

Started byRichard Maher <maher_rjSPAMLESS@hotmail.com>
First post2015-04-01 16:49 +0800
Last post2015-04-05 08:18 +0800
Articles 20 on this page of 29 — 10 participants

Back to article view | Back to comp.lang.javascript


Contents

  Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-01 16:49 +0800
    Re: Forced to browser-sniff Safari version JJ <jj4public@vfemail.net> - 2015-04-01 19:19 +0700
      Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-01 20:35 +0800
        Re: Forced to browser-sniff Safari version Denis McMahon <denismfmcmahon@gmail.com> - 2015-04-01 14:50 +0000
          Re: Forced to browser-sniff Safari version Scott Sauyet <scott.sauyet@gmail.com> - 2015-04-01 09:35 -0700
            Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 06:29 +0800
          Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 06:28 +0800
            Re: Forced to browser-sniff Safari version "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-02 01:04 +0200
        Re: Forced to browser-sniff Safari version Andrew Poulos <ap_prog@hotmail.com> - 2015-04-02 10:53 +1100
          Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 09:18 +0800
            Re: Forced to browser-sniff Safari version Andrew Poulos <ap_prog@hotmail.com> - 2015-04-02 15:12 +1100
          Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 10:25 +0800
            Re: Forced to browser-sniff Safari version Andrew Poulos <ap_prog@hotmail.com> - 2015-04-02 18:44 +1100
    Re: Forced to browser-sniff Safari version "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-04-01 17:59 -0700
      Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 10:20 +0800
        Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 20:27 +0800
          Re: Forced to browser-sniff Safari version Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 21:06 +0800
            Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-02 21:55 +0800
              Re: Opera mobile has laryngitis "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-04-02 16:28 -0700
                Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-03 07:38 +0800
                  Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-03 07:56 +0800
                    Re: Opera mobile has laryngitis Swifty <steve.j.swift@gmail.com> - 2015-04-04 07:47 +0100
                      Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-05 08:12 +0800
                        Re: Opera mobile has laryngitis Ed Jay <edMbj@aes-intl.com> - 2015-04-05 08:59 -0700
                          Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-06 06:56 +0800
                  Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-03 10:02 +0800
                Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-03 08:14 +0800
              Re: Opera mobile has laryngitis Wally W. <ww84wa@aim.com> - 2015-04-04 12:49 -0400
                Re: Opera mobile has laryngitis Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-05 08:18 +0800

Page 1 of 2  [1] 2  Next page →


#27150 — Forced to browser-sniff Safari version

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-01 16:49 +0800
SubjectForced to browser-sniff Safari version
Message-ID<mfgbeg$otv$1@speranza.aioe.org>
Can someone tell me the "best" way to detect Safari and then its version 
number?

Look, I don't want to do it but I can't find a way to pin down a WORKING 
version of speechSynthesis on Safari :-(

See below for an example that works on iOS 7.1.2 *IF* you don't add the 
onEnd listener. Apart from that everything is peachy.

In my real world full blown example it talks but still won't deliver the 
at end event.

On iOS 8 there is no issue. (I'm assuming here Safari versions are tied 
to the OS?)

Please offer a best-of-breed agent sniffer or a better 
working-feature-detector.

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function fini()
{
     alert("end");
}
function talk()
{
     if (!('speechSynthesis' in window)) {
         alert("Unsupported browser");
         return;
     }

     alert("Getting ready.");
     var utterance = "Hello World";
     var chat = new SpeechSynthesisUtterance(utterance);

     chat.addEventListener('end', fini, false);

     speechSynthesis.speak(chat);

}
</script>
</head>
<body>

<p>On Safari this example won't fire any known events<br />
onend, onerror, even onended: -</p>

<input type="button" value="Talk" onclick="talk()" />
<br /><br />
No probs on Chrome or Opera. Spewin!
</body>
</html>

[toc] | [next] | [standalone]


#27152

FromJJ <jj4public@vfemail.net>
Date2015-04-01 19:19 +0700
Message-ID<14p6gba3vihvk$.13hyy95el3gl8$.dlg@40tude.net>
In reply to#27150
Don't rely on User-Agent to determine the browser engine and version.
Detect by browser features and bugs instead.

[toc] | [prev] | [next] | [standalone]


#27153

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-01 20:35 +0800
Message-ID<mfgona$ph5$1@speranza.aioe.org>
In reply to#27152
On 4/1/2015 8:19 PM, JJ wrote:
> Don't rely on User-Agent to determine the browser engine and version.
> Detect by browser features and bugs instead.
>
On 4/1/2015 8:19 PM, JJ wrote:
 > Don't rely on User-Agent to determine the browser engine and version.
 > Detect by browser features and bugs instead.
 >
Excellent! Please show me (or even just tell me) how you you would 
detect Safari's implementation of speechSynthesis not .speak()ing or an 
ONEND event listener not firing on a completed SpeechSynthesisUtterance.

Implementation details left as an exercise for the reader?

Just thought you'd trot out some bullshit you read in Javascript Weekly?

To help you out here's my *SSCCE* again as you forgot to quote anything: -

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function fini()
{
     alert("end");
}
function talk()
{
     if (!('speechSynthesis' in window)) {
         alert("Unsupported browser");
         return;
     }

     alert("Getting ready.");
     var utterance = "Hello World";
     var chat = new SpeechSynthesisUtterance(utterance);

     chat.addEventListener('end', fini, false);

     speechSynthesis.speak(chat);

}
</script>
</head>
<body>

[toc] | [prev] | [next] | [standalone]


#27156

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2015-04-01 14:50 +0000
Message-ID<mfh0kb$k3r$2@dont-email.me>
In reply to#27153
On Wed, 01 Apr 2015 20:35:52 +0800, Richard Maher wrote:

> On 4/1/2015 8:19 PM, JJ wrote:
>> Don't rely on User-Agent to determine the browser engine and version.
>> Detect by browser features and bugs instead.

> On 4/1/2015 8:19 PM, JJ wrote:
>  > Don't rely on User-Agent to determine the browser engine and version.
>  > Detect by browser features and bugs instead.

> Excellent! Please show me (or even just tell me) how you you would
> detect Safari's implementation of speechSynthesis not .speak()ing or an
> ONEND event listener not firing on a completed SpeechSynthesisUtterance.

Identify a 'feature' whose presence or absence in the browser correlates 
to the differences in browser behaviour which you are interested in, and 
test for the presence or absence of that feature.

The best place to find out about such features is in the browser 
changelogs and / or browser specific forums.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#27157

FromScott Sauyet <scott.sauyet@gmail.com>
Date2015-04-01 09:35 -0700
Message-ID<5d9d7aa1-37f8-480a-849a-54d0b745ed16@googlegroups.com>
In reply to#27156
Denis McMahon wrote:
> Richard Maher wrote:
>> JJ wrote:
>>> Don't rely on User-Agent to determine the browser engine and version.
>>> Detect by browser features and bugs instead.
> 
>> Excellent! Please show me (or even just tell me) how you you would
>> detect Safari's implementation of speechSynthesis not .speak()ing or an
>> ONEND event listener not firing on a completed SpeechSynthesisUtterance.
> 
> Identify a 'feature' whose presence or absence in the browser correlates 
> to the differences in browser behaviour which you are interested in, and 
> test for the presence or absence of that feature.
> 
> The best place to find out about such features is in the browser 
> changelogs and / or browser specific forums.

Or by asking a well-phrased, carefully delineated question that shows
excellent understanding of what should be done before asking a question
as well as a handle on the complexities and subtleties of the subject --
in a forum frequented by people likely to have the relevant expertise
with a charter that clearly includes the topic at hand.

Richard could do that too...  Oh wait, it seems he already did.

To the OP: I'm sorry I have no suggestions at all.  Of late, I've been 
mostly insulated from significant cross-browser issues, and never dealt
with any speech synthesis APIs in any form.  But I do believe yours was
a well-asked and well-directed question.


  -- Scott

[toc] | [prev] | [next] | [standalone]


#27159

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-02 06:29 +0800
Message-ID<mfhrge$jk6$2@speranza.aioe.org>
In reply to#27157
On 4/2/2015 12:35 AM, Scott Sauyet wrote:
> Or by asking a well-phrased, carefully delineated question that shows
> excellent understanding of what should be done before asking a question
> as well as a handle on the complexities and subtleties of the subject --
> in a forum frequented by people likely to have the relevant expertise
> with a charter that clearly includes the topic at hand.
>
> Richard could do that too...  Oh wait, it seems he already did.
>
> To the OP: I'm sorry I have no suggestions at all.  Of late, I've been
> mostly insulated from significant cross-browser issues, and never dealt
> with any speech synthesis APIs in any form.  But I do believe yours was
> a well-asked and well-directed question.
>
Cheers Mate.

[toc] | [prev] | [next] | [standalone]


#27158

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-02 06:28 +0800
Message-ID<mfhre4$jk6$1@speranza.aioe.org>
In reply to#27156
On 4/1/2015 10:50 PM, Denis McMahon wrote:

> Identify a 'feature' whose presence or absence in the browser correlates
> to the differences in browser behaviour which you are interested in, and
> test for the presence or absence of that feature.
>
> The best place to find out about such features is in the browser
> changelogs and / or browser specific forums.
>

More inane platitudes from self-righteous pompous twat?

Let's acknowledge the elephant in the room - It can't be done dick-head!

[toc] | [prev] | [next] | [standalone]


#27160

From"Christoph M. Becker" <cmbecker69@arcor.de>
Date2015-04-02 01:04 +0200
Message-ID<mfhtgt$8bo$1@solani.org>
In reply to#27158
Richard Maher wrote:

> On 4/1/2015 10:50 PM, Denis McMahon wrote:
> 
>> Identify a 'feature' whose presence or absence in the browser correlates
>> to the differences in browser behaviour which you are interested in, and
>> test for the presence or absence of that feature.
>>
>> The best place to find out about such features is in the browser
>> changelogs and / or browser specific forums.
>>
> 
> More inane platitudes from self-righteous pompous twat?
> 
> Let's acknowledge the elephant in the room - It can't be done dick-head!

What Denis suggests might well be doable -- but it would only be
slightly better than browser sniffing, if at all, see [1].

If proper feature detection is not possible, as you already have
suggested, you may consider to ask somewhere else for the "best" browser
sniffing technique.  This newsgroup's FAQ, which you most certainly did
read, explicitly mentions that browser sniffing is to be avoided[2] --
so what do you expect?

[1] <http://pointedears.de/scripts/faq/cljs/notes/detect-browser/#bdOI>
[2] <http://pointedears.de/scripts/faq/cljs/#detectBrowser>

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#27161

FromAndrew Poulos <ap_prog@hotmail.com>
Date2015-04-02 10:53 +1100
Message-ID<XNednbGvN4ufGIHInZ2dnUVZ8rydnZ2d@westnet.com.au>
In reply to#27153
On 1/04/2015 11:35 PM, Richard Maher wrote:
> On 4/1/2015 8:19 PM, JJ wrote:
>> Don't rely on User-Agent to determine the browser engine and version.
>> Detect by browser features and bugs instead.
>>
> On 4/1/2015 8:19 PM, JJ wrote:
>  > Don't rely on User-Agent to determine the browser engine and version.
>  > Detect by browser features and bugs instead.
>  >
> Excellent! Please show me (or even just tell me) how you you would
> detect Safari's implementation of speechSynthesis not .speak()ing or an
> ONEND event listener not firing on a completed SpeechSynthesisUtterance.
>
> Implementation details left as an exercise for the reader?
>
> Just thought you'd trot out some bullshit you read in Javascript Weekly?

You realise that if you ever went for a job and the potential employer 
googled your name (assuming you are using your real name) then they'd 
probably view you, because of your "nasty" replies, with disdain.

Andrew Poulos

[toc] | [prev] | [next] | [standalone]


#27163

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-02 09:18 +0800
Message-ID<mfi5dg$5jj$1@speranza.aioe.org>
In reply to#27161
On 4/2/2015 7:53 AM, Andrew Poulos wrote:
> You realise that if you ever went for a job and the potential employer
> googled your name (assuming you are using your real name) then they'd
> probably view you, because of your "nasty" replies, with disdain.
>

Do you realize you are a knob?

[toc] | [prev] | [next] | [standalone]


#27167

FromAndrew Poulos <ap_prog@hotmail.com>
Date2015-04-02 15:12 +1100
Message-ID<qt2dndQgTMICXIHInZ2dnUVZ7rudnZ2d@westnet.com.au>
In reply to#27163
On 2/04/2015 12:18 PM, Richard Maher wrote:

> Do you realize you are a knob?

Sorry for trying to help you. I won't happen again.

Andrew Poulos

[toc] | [prev] | [next] | [standalone]


#27166

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-02 10:25 +0800
Message-ID<mfi9ak$bvq$2@speranza.aioe.org>
In reply to#27161
On 4/2/2015 7:53 AM, Andrew Poulos wrote:
>
> You realise that if you ever went for a job and the potential employer
> googled your name (assuming you are using your real name) then they'd
> probably view you, because of your "nasty" replies, with disdain.
>

You realize that most people, including your closest friends and family, 
look upon you as they would a skid-mark on a hotel towel.

[toc] | [prev] | [next] | [standalone]


#27168

FromAndrew Poulos <ap_prog@hotmail.com>
Date2015-04-02 18:44 +1100
Message-ID<SIedndLaM6rCboHInZ2dnUVZ8m6XnZ2d@westnet.com.au>
In reply to#27166
On 2/04/2015 1:25 PM, Richard Maher wrote:

> You realize that most people, including your closest friends and family,
> look upon you as they would a skid-mark on a hotel towel.

Sorry for trying to help you. It won't happen again.

Andrew Poulos

[toc] | [prev] | [next] | [standalone]


#27162

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2015-04-01 17:59 -0700
Message-ID<7e54ce97-7c58-48e1-b3bd-69f350cb4c28@googlegroups.com>
In reply to#27150
On Wednesday, April 1, 2015 at 3:49:28 AM UTC-5, Richard Maher wrote:
> Can someone tell me the "best" way to detect Safari and then its version 
> number?
> 
> Look, I don't want to do it but I can't find a way to pin down a WORKING 
> version of speechSynthesis on Safari :-(
> 
> See below for an example that works on iOS 7.1.2 *IF* you don't add the 
> onEnd listener. Apart from that everything is peachy.
> 
> In my real world full blown example it talks but still won't deliver the 
> at end event.
> 
> On iOS 8 there is no issue. (I'm assuming here Safari versions are tied 
> to the OS?)
> 
> Please offer a best-of-breed agent sniffer or a better 
> working-feature-detector.
> 
> <!DOCTYPE html>
> <html>
> <head>
> <script type="text/javascript">
> function fini()
> {
>      alert("end");
> }
> function talk()
> {
>      if (!('speechSynthesis' in window)) {
>          alert("Unsupported browser");
>          return;
>      }
> 
>      alert("Getting ready.");
>      var utterance = "Hello World";
>      var chat = new SpeechSynthesisUtterance(utterance);
> 
>      chat.addEventListener('end', fini, false);
> 
>      speechSynthesis.speak(chat);
> 
> }
> </script>
> </head>
> <body>
> 
> <p>On Safari this example won't fire any known events<br />
> onend, onerror, even onended: -</p>
> 
> <input type="button" value="Talk" onclick="talk()" />
> <br /><br />
> No probs on Chrome or Opera. Spewin!
> </body>
> </html>

On Safari is the button failing silently onclick? Is it not throwing an exception when it sees: "new SpeechSynthesisUtterance"? If it at least throw an error you could wrap with try..catch 

[toc] | [prev] | [next] | [standalone]


#27165

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-02 10:20 +0800
Message-ID<mfi92f$bvq$1@speranza.aioe.org>
In reply to#27162
On 4/2/2015 8:59 AM, Michael Haufe (TNO) wrote:
>
> On Safari is the button failing silently onclick? Is it not

>  throwing an exception when it sees: "new SpeechSynthesisUtterance"?

>If it at least throw an error you could wrap with try..catch
>

You're a bloody champion Michael! Talk about can't see the wood for the 
trees. I was suffering under delusions of adequacy and had tried 
try/catch around speechSynthesis.speak(chat) but not the 
SpeechSynthesisUtterance instantiation.

Still no joy there BUT an exception was being thrown by 
chat.addEventListener('end', fini, false);

Nothing in the console log but I guess I shouldn't wait to be spoon-fed.

Thanks again!

[toc] | [prev] | [next] | [standalone]


#27169

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-02 20:27 +0800
Message-ID<mfjcjh$oaq$1@speranza.aioe.org>
In reply to#27165
On 4/2/2015 10:20 AM, Richard Maher wrote:
>
> Still no joy there BUT an exception was being thrown by
> chat.addEventListener('end', fini, false);
>
> Nothing in the console log but I guess I shouldn't wait to be spoon-fed.
>
> Thanks again!

For those still following, Safari has been put to bed, Chrome works 
beautifully (and seems the only one to support rate and pitch), The 
Android browser can't handle Web Workers so it's out already, Opera 
desktop has a sexy default voice, FireFox and IE were never in the running.

Which leaves Opera Mobile which fails silently without throwing anything :-(

I'll look tomorrow at attribute sniffing for what 
https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section says 
should be there but any other useful options welcome?

[toc] | [prev] | [next] | [standalone]


#27170

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-02 21:06 +0800
Message-ID<mfjesa$u75$1@speranza.aioe.org>
In reply to#27169
On 4/2/2015 8:27 PM, Richard Maher wrote:
>
> For those still following, Safari has been put to bed, Chrome works
> beautifully (and seems the only one to support rate and pitch), The
> Android browser can't handle Web Workers so it's out already, Opera
> desktop has a sexy default voice, FireFox and IE were never in the running.
>
> Which leaves Opera Mobile which fails silently without throwing anything
> :-(
>
> I'll look tomorrow at attribute sniffing for what
> https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section says
> should be there but any other useful options welcome?
>

I've checked the "speaking" attribute and it's there as "false".
I've stuck "onerror" and "onabort" handlers in as well and still nothing.
I passed a string instead of a correct utterance object and bloody Opera 
throws and "undefined" exception like everyone else.

Opera Mobile 28.0
Android 4.4.2

Good-night :-(

[toc] | [prev] | [next] | [standalone]


#27171 — Opera mobile has laryngitis

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-02 21:55 +0800
SubjectOpera mobile has laryngitis
Message-ID<mfjhpg$5vm$1@speranza.aioe.org>
In reply to#27170
On 4/2/2015 9:06 PM, Richard Maher wrote:
> On 4/2/2015 8:27 PM, Richard Maher wrote:
>>
>> For those still following, Safari has been put to bed, Chrome works
>> beautifully (and seems the only one to support rate and pitch), The
>> Android browser can't handle Web Workers so it's out already, Opera
>> desktop has a sexy default voice, FireFox and IE were never in the
>> running.
>>
>> Which leaves Opera Mobile which fails silently without throwing anything
>> :-(
>>
>> I'll look tomorrow at attribute sniffing for what
>> https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
>> says
>> should be there but any other useful options welcome?
>>
>
> I've checked the "speaking" attribute and it's there as "false".
> I've stuck "onerror" and "onabort" handlers in as well and still nothing.
> I passed a string instead of a correct utterance object and bloody Opera
> throws and "undefined" exception like everyone else.
>
> Opera Mobile 28.0
> Android 4.4.2
>
> Good-night :-(

You (and *I*) may question the correctness of this behaviour in Opera 
but it appears to be as simple as there are no 
known/registered/available voices for Opera Mobile on my Android phone :-(


"Sing for me Christine! Sing my angel, SING!" Sorry couldn't help it.

So are there any files I have to download?

FYI on Safari, apparently, the speechSynthesis.getVoices() method is 
synchronous which makes life easy. Elsewhere it is asynchronous and will 
return an array of length 0 on first call.

We need to register an event such as: -
speechSynthesis.onvoiceschanged = function() {
         voices = window.speechSynthesis.getVoices();
         alert("Voices " + voices.length);
         if (!done) theWork();
         };

This never fires on Opera Mobile. Curious!

Why don't I get a (from the synthesis specification): -
           "language-unavailable",
           "voice-unavailable",

Because I didn't explicitly specify a language and a voice?

And why does Chrome deliver onvoiceschanged 3 times?

[toc] | [prev] | [next] | [standalone]


#27178 — Re: Opera mobile has laryngitis

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2015-04-02 16:28 -0700
SubjectRe: Opera mobile has laryngitis
Message-ID<0979188e-79e9-48ee-abeb-9fc11cb50982@googlegroups.com>
In reply to#27171
On Thursday, April 2, 2015 at 8:56:28 AM UTC-5, Richard Maher wrote:
> 
> You (and *I*) may question the correctness of this behaviour in Opera 
> but it appears to be as simple as there are no 
> known/registered/available voices for Opera Mobile on my Android phone :-(
> 
> 
> "Sing for me Christine! Sing my angel, SING!" Sorry couldn't help it.
> 
> So are there any files I have to download?
> 
> FYI on Safari, apparently, the speechSynthesis.getVoices() method is 
> synchronous which makes life easy. Elsewhere it is asynchronous and will 
> return an array of length 0 on first call.
> 
> We need to register an event such as: -
> speechSynthesis.onvoiceschanged = function() {
>          voices = window.speechSynthesis.getVoices();
>          alert("Voices " + voices.length);
>          if (!done) theWork();
>          };
> 
> This never fires on Opera Mobile. Curious!
> 
> Why don't I get a (from the synthesis specification): -
>            "language-unavailable",
>            "voice-unavailable",
> 
> Because I didn't explicitly specify a language and a voice?
> 
> And why does Chrome deliver onvoiceschanged 3 times?

Is this a standard event? I don't see onvoiceschanged in the spec:

https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechreco-events

Which could be why Opera is not firing this method?

[toc] | [prev] | [next] | [standalone]


#27179 — Re: Opera mobile has laryngitis

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2015-04-03 07:38 +0800
SubjectRe: Opera mobile has laryngitis
Message-ID<mfkju6$qbh$1@speranza.aioe.org>
In reply to#27178
On 4/3/2015 7:28 AM, Michael Haufe (TNO) wrote:
>
> Is this a standard event? I don't see onvoiceschanged in the spec:
>
> https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechreco-events
>
> Which could be why Opera is not firing this method?
>

Whether it is or isn't is a moot point as we have to cater for both 
behaviours anyway. (Safari -vs- Chrome)

If the first getVoices call receives a zero length array I (seems 
wrongly in this case) assume that the browser will update me later with 
a list.

But regardless of the programming solutions to that conundrum I appear 
to have a configuration/installation issue. I re-installed Opera 28 but 
still no joy. Either I'm missing a few files of the Voice URIs are wrong 
somewhere?

Cheers

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.javascript


csiph-web