我有一个API,当我在Android中执行HTTP get时,它会接收一个字符串并转换为音频。我希望能够在收到它时播放它,但我不知道该怎么做。有人能帮我吗。到目前为止,这是我的代码:
public static String getHTML(String urlToRead) throws Exception {
StringBuilder result = new StringBuilder();
URL url = new URL(urlToRead);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");