Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在javaweb应用程序中使用在线API_Java_Jsp_Servlets_Web Applications - Fatal编程技术网

如何在javaweb应用程序中使用在线API

如何在javaweb应用程序中使用在线API,java,jsp,servlets,web-applications,Java,Jsp,Servlets,Web Applications,我正在做我大学最后一年的项目,我正在开发一个项目,在这个项目中我可以使用任何文本到语音的在线api。我的项目是基于servlet和jsp的web应用程序,但我不知道如何在代码中使用API。有人能帮我吗 我见过一个免费的TTS Api,例如。使用: 使用例如library从代码中调用API。@JozefChocholacek您能提供一些实现细节吗?因为这对我来说是一件非常新鲜的事情,网站上的教程都是非常高水平的。 String key = "..."; // your API key byte[]

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

我见过一个免费的TTS Api,例如。

使用:


使用例如library从代码中调用API。@JozefChocholacek您能提供一些实现细节吗?因为这对我来说是一件非常新鲜的事情,网站上的教程都是非常高水平的。
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