Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

voice-player autoplay don't speach when textChange #8

Open
jmorille opened this issue Sep 15, 2014 · 1 comment
Open

voice-player autoplay don't speach when textChange #8

jmorille opened this issue Sep 15, 2014 · 1 comment

Comments

@jmorille
Copy link

Bug 1 : The event textChanged should play the new text in autoplay=true mode.
The solution is something like that (int voice-player)

 textChanged: function() {
                this.speech.text = this.text;
                if (this.autoplay) {
                    this.speak();
                }
            },

Bug 2 : In autoplay=false, is not possible to call speach function with the current text
Each time it play the old one, because the event textChanged, arrive after the speachTextChanged
like this sample

  <template>
     <core-input inputValue="{{searchText}}"></core-input>
    <paper-icon-button icon="search" on-tap="{{speachButtonHanlder}}"></paper-icon-button>
     <voice-player id="search_notif_vocal" text="{{speachText}}" accent="en-US" autoplay="true"></voice-player>
  </template>
  <script>
       ...
            speachButtonHanlder : function (e) {
               this.$.search_notif_vocal.setAttribute("text", this. speachText);
                this.$.search_notif_vocal.speak();
            },
       ...
  </script>

This code play all the time the old Text.

@dasher
Copy link

dasher commented May 7, 2015

Incase anybody stumbles over this issue - it's due to the event loop.
A quick work around is:

  setTimeout
    function() {
        speachDispatcher.speak();
    }, 200);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants