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

Text to speech not speaking texts even if it was told to do so in v4 #1770

Closed
leolorenzoluis opened this issue Feb 27, 2019 · 7 comments
Closed
Assignees
Labels
area-docs Documentation required area-speech backlog Out of scope for the current iteration but it will be evaluated in a future release. Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete. question Further information is requested. Stack Overflow candidate

Comments

@leolorenzoluis
Copy link

Referencing #1179

Is this still possible in v4? I can't seem to find lastInputViaSpeech in the repository. How do I tell the bot to always speak whatever it is trying to say?

@leolorenzoluis leolorenzoluis changed the title Text to speech not working in v4 Text to speech not speaking texts even if it was told to do so in v4 Feb 27, 2019
@corinagum
Copy link
Contributor

corinagum commented Mar 6, 2019

lastInputViaSpeech appears to be a Web Chat v3 feature that is no longer compatible with v4. I'm inclined to say this was intentionally removed because the intended action of a bot is to use speech only when spoken to, see Enable Web Chat docs (second paragraph)

However the issue you linked appears to disagree with that. @compulim, do you have input? Have there been changes in the past over how speech bots should function?

@corinagum corinagum added question Further information is requested. Stack Overflow candidate area-docs Documentation required Pending labels Mar 6, 2019
@leolorenzoluis
Copy link
Author

leolorenzoluis commented Mar 7, 2019

What's the design reason as to why you only want the bot to speak if microphone was used by the user? To me that's a limiting functionality. I want the bot to speak at a welcome chat or always talk for accessibility issue without having to require the user to speak. What if the user can't talk but requires to hear what the bot is saying?

@compulim
Copy link
Contributor

@corinagum Could you try out something?

  • Instantiate Web Chat with a custom store
  • Call store.dispatch({ type: 'WEB_CHAT/START_SPEAKING' })
  • And then type echo ABC in Web Chat
  • Verify if the bot is speaking the response, or not
    • If yes, this is the solution
    • If not, we might be disabling speak after the user send the last message via keyboard, and we need to find a better story for this scenario

@corinagum
Copy link
Contributor

Hey @leolorenzoluis, @compulim and I had a fun discussion about this today and got this non-recommended workaround code to work: (it's a bit hack-y)

        const store = window.WebChat.createStore({}, ({ dispatch }) => next => action => {
          console.log(action.type);
          if(action.type === 'DIRECT_LINE/INCOMING_ACTIVITY' && action.payload.activity.from.role !== 'user') {
            // We need to postpone the dispatch because we need to wait until the reducer adds this activity to the store, before we can mark it to be spoken.
            setImmediate(() => {
              store.dispatch({ type: 'WEB_CHAT/MARK_ACTIVITY', payload: { activityID: action.payload.activity.id, name: 'speak', value: true } });
            });
          }
          return next(action);
        });

Meanwhile, we are waiting to continue discussion on whether we want to use channel data to pass customization to Web Chat. This would be a flag indicating that the bot should always speak incoming activities from the bot, regardless if the user begins typing in the sendbox. I'll update this issue again once that discussion has taken place. :)

@corinagum corinagum assigned cwhitten and unassigned compulim Mar 26, 2019
@corinagum corinagum added Approved front-burner backlog Out of scope for the current iteration but it will be evaluated in a future release. and removed Triage-E labels Mar 26, 2019
@corinagum
Copy link
Contributor

Although hacky, workaround provided is sufficient for now. Web Chat team would like to discuss this UX with a conversation designer before implementing any code changes.

@compulim
Copy link
Contributor

compulim commented Nov 3, 2019

This is also related to #2211. When we implement the feature, it will fix this issue.

@cwhitten
Copy link
Member

Closing this. Please follow #2211 for updated to this issue.

@cwhitten cwhitten added the Bot Services Required for internal Azure reporting. Do not delete. Do not change color. label Feb 26, 2021
@cwhitten cwhitten added customer-reported Required for internal Azure reporting. Do not delete. customer-replied-to Required for internal reporting. Do not delete. labels Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-docs Documentation required area-speech backlog Out of scope for the current iteration but it will be evaluated in a future release. Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete. question Further information is requested. Stack Overflow candidate
Projects
None yet
Development

No branches or pull requests

6 participants