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 does not work in 06.c.cognitive-services-speech-services-js #2162

Closed
Adityagrao opened this issue Jul 10, 2019 · 8 comments
Closed
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete.

Comments

@Adityagrao
Copy link

Describe the bug

The readme file says " A simple page with Web Chat integrated with speech-to-text and text-to-speech feature from Cognitive Services Speech Services."

But only Speech to text feature works and the bot does not speak out the response

To Reproduce

Steps to reproduce the behavior:

  • Click on the microphone button
  • Say anything
  • The bot gives back the response in the text but does not speak it out

Expected behavior

The bot should also speak out the text value

@Adityagrao Adityagrao added bug Indicates an unexpected problem or an unintended behavior. Pending labels Jul 10, 2019
@saurav2107
Copy link

I am facing the same issue

@saurav2107
Copy link

How can Microsoft stop Bing Speech Service, If it does not have a proper alternative?

@corinagum
Copy link
Contributor

We've had some modifications related to speech for the 4.5 release that I believe should resolve the issue you're reporting. Could one or both of you please test this scenario against the latest bits?

I tested on latest bits just now and the bot responded via speech as expected.

Please let me know your findings.

@compulim
Copy link
Contributor

@saurav2107 Cognitive Services Bing Speech is in deprecated mode since mid-October 2018. And it is being replaced by Cognitive Services Speech Services. If you are using Bing Speech outside of Web Chat, you can refer to this migration note to see how to move it.

Are you using Safari for testing? There is a work item #995 to make text-to-speech works on Safari.

@Adityagrao
Copy link
Author

I am running it on Chrome Version 75.0.3770.100 and running it using vanilla JS,

@corinagum when will the same be pushed to the latest

@compulim
Copy link
Contributor

I think this is related to #1829.

4.5.0 is out on NPM and we are pushing it to CDN. Should get it done tomorrow.

@Adityagrao
Copy link
Author

I built the latest bits and ran, and it giving me the text to speech, I saw that the function

import createPonyfill from 'web-speech-cognitive-services/lib/SpeechServices';

function injectReferenceGrammarID({ SpeechGrammarList, SpeechRecognition }, referenceGrammarID) {
  return class extends SpeechRecognition {
    start() {
      this.grammars = new SpeechGrammarList();
      this.grammars.referenceGrammar = referenceGrammarID || '';

      return super.start();
    }
  };
}

export default async function createCognitiveServicesSpeechServicesPonyfillFactory({
  authorizationToken,
  region,
  subscriptionKey,
  textNormalization
}) {
  console.warn(
    'Web Chat: Cognitive Services Speech Services support is currently in preview. If you encounter any problems, please file us an issue at https://github.com/microsoft/BotFramework-WebChat/issues/.'
  );

  const ponyfill = await createPonyfill({
    authorizationToken,
    region,
    subscriptionKey,
    textNormalization
  });

  const { SpeechGrammarList, speechSynthesis, SpeechSynthesisUtterance } = ponyfill;

  return ({ referenceGrammarID }) => ({
    SpeechGrammarList,
    SpeechRecognition: injectReferenceGrammarID(ponyfill, referenceGrammarID),
    speechSynthesis,
    SpeechSynthesisUtterance
  });
}

takes in speechSynthesis, I wanted to know how do I specify NeuralVoice ie "JessaNeural" for the text to speech

@corinagum
Copy link
Contributor

I'm glad text to speech is working again for you. Thanks for filing.

'How to' questions such as questions regarding voice font are better suited for Stack Overflow. Please feel free to post other questions you have about developing your own features over there so the community at large may help out. If you need help with a Web Chat implementation, you can post a question to the Web Chat tag. Thank you!

@corinagum corinagum removed the Pending label Jul 11, 2019
@daveta daveta added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Required for internal Azure reporting. Do not delete. customer-replied-to Required for internal reporting. Do not delete. labels Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete.
Projects
None yet
Development

No branches or pull requests

5 participants