Add Pascal API for Kokoro TTS models (#1724)

This commit is contained in:
Fangjun Kuang
2025-01-16 18:20:21 +08:00
committed by GitHub
parent 4335e2accd
commit 46f2e32e8a
10 changed files with 444 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
program matcha_en_playback;
{
This file shows how to use the text to speech API of sherpa-onnx
with Piper models.
with MatchaTTS models.
It generates speech from text and saves it to a wave file.
@@ -210,8 +210,8 @@ begin
Audio := Tts.Generate(Text, SpeakerId, Speed,
PSherpaOnnxGeneratedAudioCallbackWithArg(@GenerateCallback), nil);
FinishedGeneration := True;
SherpaOnnxWriteWave('./matcha-zh-playback.wav', Audio.Samples, Audio.SampleRate);
WriteLn('Saved to ./matcha-zh-playback.wav');
SherpaOnnxWriteWave('./matcha-en-playback.wav', Audio.Samples, Audio.SampleRate);
WriteLn('Saved to ./matcha-en-playback.wav');
while not FinishedPlaying do
Pa_Sleep(100); {sleep for 0.1 second }