This is a tool to generate audio files of sentences in English and their translation in Chinese. I use it as part of my personal method to learn new languages.
The speech synthesis uses this model from Hugging Face to prevent the sentences from sounding too robotic.
This repository uses Git Large File Storage (LFS) to handle the local AI voice models (models/model.onnx).
Before cloning this repository, you must have Git LFS installed on your machine. Otherwise, the model files will not download correctly, and the script will fail.
- Install Git LFS:
brew install git-lfs
- Set up Git LFS globally on your system:
git lfs install
- Clone this repository
- Install dependencies with
pnpm i(ornpm iif you don't have pnpm) - Edit the sentences and the parameters in index.js
- Run the script to generate the audio file:
node index.js