websockets stuff

This commit is contained in:
mathieu 2022-12-02 15:45:01 +01:00
parent be4df87c99
commit 8c50b26b71
2 changed files with 7 additions and 5 deletions

View File

@ -177,11 +177,11 @@ fun DisplayMainPage(
SocketHandler.processMessage("test", MainActivity().uniqueID)
thread {
//val requestOutput = getTextFromAudio(audioRecorder.getOutputFile())
val requestOutput = getTextFromAudio(audioRecorder.getOutputFile())
val temp = JSONObject()
/*val temp = JSONObject()
temp.put("data", "salut je suis bob")
val requestOutput = temp.toString()
val requestOutput = temp.toString()*/
processing = false

View File

@ -37,11 +37,13 @@ object SocketHandler {
val body = JSONObject()
body.put("data", message)
body.put("uuid", uuid)
getSocket().emit("process_message", body)
getSocket().emit("process_message", body.toString())
}
@Synchronized
fun joinRoom(uuid: String) {
getSocket().emit("join", uuid)
val body = JSONObject()
body.put("uuid", uuid)
getSocket().emit("join", body.toString())
}
}