Marak / say.js

TTS (text to speech) for node.js. send text from node.js to your speakers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to read Chinese?

wangrongding opened this issue · comments

Reading Chinese will be garbled

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

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.')
})

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

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

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.

Thanks!!!