Closed Bug 1262067 Opened 8 years ago Closed 8 years ago

No voice at Nightly 2016-04-04.

Categories

(Core :: Web Speech, defect)

Unspecified
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

(Keywords: regression)

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1254378 +++

After landing bug 1254378, OSX backend returns no voice.

Step
Run console.log(speechSynthesis.getVoices().length);

Result
0

OSXSpeechSynthesisService uses lazy initialization for enumerating voices.  So after landing 1254387, we should call Init() into GetInstance().
Assignee: nobody → m_kato
This is expected behavior.

You need to listen for speechSynthesis.onvoiceschanged to get notified of added voices.

It isn't pretty, I know. Chrome already works that way.
No longer depends on: 1237082
No longer blocks: 1252732
(In reply to Eitan Isaacson [:eeejay] from comment #1)
> This is expected behavior.
> 
> You need to listen for speechSynthesis.onvoiceschanged to get notified of
> added voices.
> 
> It isn't pretty, I know. Chrome already works that way.

I should write more detail of this bug.  OSXSpeechSynthService::Init() isn't called well, so there is no voice after landing bug 1254378.
Keywords: regression
OSXSpeechSynthesisService::Observe calls Init() by profile-after-changed.  After landing bug 1254387, we should change logic to call Init().  We should call it on GetInstance() instead.
Right. Missed that.
OSX speech synthesis is broken after landing bug 1254378.  By this bug, this service is never called on start up.
Although this observer is for start up time regression, it is unnecessary now. So it should be initialized at GetInstance() instead.

Review commit: https://reviewboard.mozilla.org/r/44283/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/44283/
Attachment #8738078 - Flags: review?(eitan)
Comment on attachment 8738078 [details]
MozReview Request: Bug 1262067 - Call Init() instead of using profile-after-changed observer. r?eeejay

https://reviewboard.mozilla.org/r/44283/#review41065

I have one concern below. It looks like the behavior would be different with this patch. Before this patch, there would be one instance, and Init would either fail or succeed. In this patch, we will keep creating instances if Init fails and thowing them away.

::: dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm:439
(Diff revision 1)
>  
>    if (!sSingleton) {
> -    sSingleton = new OSXSpeechSynthesizerService();
> +    RefPtr<OSXSpeechSynthesizerService> speechService =
> +      new OSXSpeechSynthesizerService();
> +    if (speechService->Init()) {
> +      sSingleton = speechService;

Aren't we just going to create new service instances again and again if Init() returns false?
Attachment #8738078 - Flags: review?(eitan)
https://reviewboard.mozilla.org/r/44283/#review41065

Init()  has to be successful.  I should use MOZ_ALWAYS_SUCCEEDS instead.
https://reviewboard.mozilla.org/r/44283/#review41065

> Aren't we just going to create new service instances again and again if Init() returns false?

Ah, It is unnecessary to check false becasue no chance to create instance again.  So I use MOZ_ALWAYS_SUCCEEDS instead.
Comment on attachment 8738078 [details]
MozReview Request: Bug 1262067 - Call Init() instead of using profile-after-changed observer. r?eeejay

https://reviewboard.mozilla.org/r/44283/#review41761
Attachment #8738078 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/3a5d44c806e5
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Version: unspecified → Trunk
You need to log in before you can comment on or make changes to this bug.