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

Add iOS TTS example for MatchaTTS #1736

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Conversation

csukuangfj
Copy link
Collaborator

@csukuangfj csukuangfj commented Jan 20, 2025

Steps to run it on the iOS simulator inside xcode

1. Download and build the code

mkdir -p ~/open-source/
cd ~/open-source
git clone https://github.com/k2-fsa/sherpa-onnx
cd sherpa-onnx
./build-ios.sh

Note that you can put sherpa-onnx anywhere you like. We use ~/open-source as an example

2. Download the tts model

Please refer to
https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/matcha.html#matcha-icefall-zh-baker-chinese-1-female-speaker
to download models.

mkdir -p ~/open-source/icefall-models
cd ~/open-source/icefall-models

wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2
tar xvf matcha-icefall-zh-baker.tar.bz2
rm matcha-icefall-zh-baker.tar.bz2

wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx

Note that you can put model files anywhere you like. We use ~/open-source/icefall-models as an example

3. Start xcode

Start xcode and open the project
https://github.com/k2-fsa/sherpa-onnx/tree/master/ios-swiftui/SherpaOnnxTts

4. Add the TTS model to the project

Screenshot 2025-01-20 at 11 17 25 Screenshot 2025-01-20 at 11 18 09

5. Add the vocoder

Screenshot 2025-01-20 at 11 19 22

6. Check that you have added all the required files for Matcha TTS

Screenshot 2025-01-20 at 11 38 45 Screenshot 2025-01-20 at 11 19 39

@csukuangfj csukuangfj merged commit e2f096b into k2-fsa:master Jan 20, 2025
@csukuangfj csukuangfj deleted the ios-matcha branch January 20, 2025 03:42
@csukuangfj
Copy link
Collaborator Author

Here is the version of xcode I am using

Screenshot 2025-01-20 at 12 54 01

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

Successfully merging this pull request may close these issues.

1 participant