static S witAI_recognizeWAV(File mp3File) ctex { if (wavFile.length() == 0) fail("No file: " + wavFile); print("Calling wit.ai with " + toK(wavFile.length()) + " K wav..."); S token = witAIToken(); URL url = new URL("https://api.wit.ai/speech?v=20160526"); URLConnection con = url.openConnection(); con.setRequestProperty("Authorization", "Bearer " + token); con.setRequestProperty("Content-Type", "audio/wav"); con.setDoOutput(true); OutputStream out = con.getOutputStream(); file2stream(mp3File, out); out.flush(); S json = loadPage(con, url); out.close(); ret getString(jsonDecodeMap(json), "_text"); }