Add Java and Kotlin API for Supertonic TTS (#3289)

This pull request enhances the Text-to-Speech capabilities by integrating the Supertonic TTS model into the existing Java and Kotlin APIs. It provides developers with new tools and clear examples to generate speech from text using this model, expanding the range of available TTS options and simplifying their adoption within Java and Kotlin projects.
This commit is contained in:
Fangjun Kuang authored and GitHub committed 2026-03-12 00:05:25 +08:00
1 parent b6a563ab05
commit 3ca8943d61
21 files changed
+384 -24

No files matched your search

@@ -43,13 +43,13 @@ public class NonStreamingTtsPiperEn {
float timeElapsedSeconds = (stop - start) / 1000.0f;
float audioDuration = audio.getSamples().length / (float) audio.getSampleRate();
float real_time_factor = timeElapsedSeconds / audioDuration;
float realTimeFactor = timeElapsedSeconds / audioDuration;
String waveFilename = "tts-piper-en.wav";
audio.save(waveFilename);
System.out.printf("-- elapsed : %.3f seconds\n", timeElapsedSeconds);
System.out.printf("-- audio duration: %.3f seconds\n", audioDuration);
System.out.printf("-- real-time factor (RTF): %.3f\n", real_time_factor);
System.out.printf("-- real-time factor (RTF): %.3f\n", realTimeFactor);
System.out.printf("-- text: %s\n", text);
System.out.printf("-- Saved to %s\n", waveFilename);