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

How to read Chinese? #120

Open
wangrongding opened this issue Jun 10, 2021 · 8 comments
Open

How to read Chinese? #120

wangrongding opened this issue Jun 10, 2021 · 8 comments

Comments

@wangrongding
Copy link

Reading Chinese will be garbled

@wangrongding
Copy link
Author

eg. 我想吃饭 -> %E6%88%91%E6%83%B3%E5%90%83%E9%A5%AD

@loicpirez
Copy link

Works fine for me.

const say = require('say')
say.export("出租汽车", 'Ting-Ting', 1, 'taxi.wav', (err) => {
  if (err) {
    return console.error(err)
  }

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

@silence19
Copy link

Hi guys, I have found a solution for Chinese, please check this if you like.

@Kayakyx
Copy link

Kayakyx commented May 28, 2022

On Windows you need to change the terminal encoding to UTF8.

  1. Run chcp on the terminal to see the current encoding.
  2. Run chcp 65001 to change the encoding to UTF8.
    Then re-execute the JS file.

Example:
chcp 65001 && node demo.js

@silence19
Copy link

On Windows you need to change the terminal encoding to UTF8.

  1. Run chcp on the terminal to see the current encoding.
  2. Run chcp 65001 to change the encoding to UTF8.
    Then re-execute the JS file.

Example: chcp 65001 && node demo.js

Sorry, I am not sure, the say.js is embeded in the plugin I needed, so that it will always reset to chcp 936 when running. I'll see if I can make it work in this way.

@zld150
Copy link

zld150 commented Jan 13, 2023

Thanks!!!

@one0410
Copy link

one0410 commented Dec 19, 2024

on Windows, open a powershell terminal, and input following command

Add-Type -AssemblyName System.Speech
$NewMessage = New-Object System.Speech.Synthesis.SpeechSynthesizer
$NewMessage.GetInstalledVoices() | select -ExpandProperty VoiceInfo | select Name, Gender, Description

Then you can get following result

Name Gender Description


Microsoft David Desktop Male Microsoft David Desktop - English (United States)
Microsoft Zira Desktop Female Microsoft Zira Desktop - English (United States)
Microsoft Hanhan Desktop Female Microsoft Hanhan Desktop - Chinese (Taiwan)

choose one of voice above.

in your code, you can use say.speak('中文測試', 'Microsoft Hanhan Desktop');

@jayjayhust
Copy link

jayjayhust commented Jan 26, 2025

On Windows you need to change the terminal encoding to UTF8.

  1. Run chcp on the terminal to see the current encoding.
  2. Run chcp 65001 to change the encoding to UTF8.
    Then re-execute the JS file.

Example: chcp 65001 && node demo.js

Perfect solution~

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

7 participants