如何在 java 网络应用程序中使用在线 API

How to use online API in java web Application

我正在做我的大学最后一年的项目,我一直在开发一个项目,我在其中使用任何文本在线语音 api。我的项目是基于 servlet 和 jsp 的 Web 应用程序,但我不知道如何在我的代码中使用 API。谁能帮帮我

我看过免费的 TTS Api,例如 http://www.voicerss.org/api/documentation.aspx

使用Fluent HC:

String key = "..."; // your API key
byte[] mp3speech = Request.Get("http://api.voicerss.org/?key=" + key + "&hl=en-us&src=I+am+very+lazy+student.").execute().returnContent().asBytes();
// do anything you need with the result