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

Cannot set voice. No matching voice is installed or the voice was disabled #137

Closed
liudonghua123 opened this issue May 8, 2024 · 2 comments

Comments

@liudonghua123
Copy link

I tried the example code on windows. But it failed with Error: Exception calling "SelectVoice" with "1" argument(s): "Cannot set voice. No matching voice is installed or the voice was disabled." error.

Details
Liu.D.H  say_it   2.788s  10:56 > cat > index.js
// automatically pick platform
const say = require('say')

// or, override the platform
// const Say = require('say').Say
// const say = new Say('darwin' || 'win32' || 'linux')

// Use default system voice and speed
say.speak('Hello!')

// Stop the text currently being spoken
say.stop()

// More complex example (with an OS X voice) and slow speed
say.speak("What's up, dog?", 'Alex', 0.5)

// Fire a callback once the text has completed being spoken
say.speak("What's up, dog?", 'Good News', 1.0, (err) => {
  if (err) {
    return console.error(err)
  }

  console.log('Text has been spoken.')
});

// Export spoken audio to a WAV file
say.export("I'm sorry, Dave.", 'Cellos', 0.75, 'hal.wav', (err) => {
  if (err) {
    return console.error(err)
  }

  console.log('Text has been saved to hal.wav.')
})

Liu.D.H  say_it   13ms  10:57 > node .
Error: Exception calling "SelectVoice" with "1" argument(s): "Cannot set voice. No matching voice is installed or the voice was disabled."
At line:1 char:100
+ ... eech.Synthesis.SpeechSynthesizer;$speak.SelectVoice('Cellos');$speak. ...
+                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    at Socket.<anonymous> (D:\code\node\playground\say_it\node_modules\say\platform\base.js:105:16)
    at Object.onceWrapper (node:events:635:26)
    at Socket.emit (node:events:520:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)
Error: Exception calling "SelectVoice" with "1" argument(s): "Cannot set voice. No matching voice is installed or the voice was disabled."
At line:1 char:100
+ ... h.Synthesis.SpeechSynthesizer;$speak.SelectVoice('Good News');$speak. ...
+                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentException


    at Socket.<anonymous> (D:\code\node\playground\say_it\node_modules\say\platform\base.js:44:16)
    at Object.onceWrapper (node:events:635:26)
    at Socket.emit (node:events:520:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)

Liu.D.H  say_it   7.509s  10:57 >
@liudonghua123
Copy link
Author

I tested $speak on windows. it seems like the voice chooser has bug.

image

@liudonghua123
Copy link
Author

I found it's the code problem, I need to update the example code around voice like 'Good News' or 'Alex' which doesn't exists locally.

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

1 participant