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

macOS: calling SpeechSynthesizer.StopSpeakingAsync() and then StartSpeakingTextAsync() does not work immediately #2367

Closed
bpasero opened this issue May 7, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@bpasero
Copy link

bpasero commented May 7, 2024

Describe the bug

A call to SpeechSynthesizer.StopSpeakingAsync() with a new StartSpeakingTextAsync does not synthesise for up to 30 seconds. The log file is here: log.txt

This issue maybe related to #2350 and #1836 and #2264

To Reproduce

We are building a node.js binding for Speech SDK and the C++ sources mimic the samples. The synthesis is implemented here: https://github.com/microsoft/node-speech/blob/967976ce0f4887a2b5b27f486e5209a51588516f/src/main.cc#L477

The call to StopSpeakingAsync here: https://github.com/microsoft/node-speech/blob/967976ce0f4887a2b5b27f486e5209a51588516f/src/main.cc#L539

To reproduce from that module:

  • using node.js 18.x on the system
  • git clone https://github.com/microsoft/node-speech.git
  • open index.ts and append the snippet [1] at the end
  • from a terminal cd into the workspace and run npm i
  • run node index.js

[1]

const t = createSynthesizer({
  modelPath: '<path to TTS model>',
  modelName: 'Microsoft Server Speech Text to Speech Voice (en-US, AriaNeural)',
  modelKey: '<model key>',
}, (error, result) => {
  if (error) {
    console.error(error);
  } else {
    console.log(result);
  }
});
t.synthesize(`
Now more than ever, developers are expected to build voice-enabled applications that can reach a global audience. With the same voice persona across languages, organizations can keep their brand image more consistent. To support the growing need for a single voice to speak multiple languages, particularly in scenarios such as localization and translation, a multi-lingual neural TTS voice is brought out in public preview.
`);
setTimeout(() => {
  console.log('stopping');
  t.stop();
}, 2000);
setTimeout(() => {
  console.log('synthesizing');
  t.synthesize(`This text is not synthesized`);
}, 3000);

Expected behavior

Calling SpeechSynthesizer.StopSpeakingAsync immediately stops synthesis and StartSpeakingTextAsync works right after.

Version of the Cognitive Services Speech SDK

1.37.0

Platform, Operating System, and Programming Language

  • OS: macOS 14.4.1
  • Hardware: ARM
  • Programming language: C++

//cc @ralph-msft

@pankopon
Copy link
Contributor

Closed as duplicate with the same cause as in #2350.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants