SEI-TAS / pycloud

Server software to manage virtualized services on a KVM-based discoverable cloudlet (Cloudlet Server component of the KD-Cloudlet.project)
Other
20 stars 11 forks source link

Processing the data returned by the speech server to the Android client #10

Closed haiyunaixueye closed 6 years ago

haiyunaixueye commented 6 years ago

Hello, I want to process the data returned by the speech server to Android. What file is the code that controls the return data?

sebastian-echeverria commented 6 years ago

To be honest, I do not know much about the inner workings of the Speech client and server, since another person worked on them and I haven't had to modify their code. From what I see, the file: src/main/java/edu/cmu/sei/ams/clouldet/speechrec/server/SpeechRecognitionServerHandler.java handles messages and writes the output; more specifically, SpeechRecognitionServerHandler.messageReceived().

In terms of the client, speech-android/src/main/java/edu/cmu/sei/sphinxandroid/SphinxAndroidClientActivity.java handles the communication, in particular the SendAudio class inside that file.

Something else that may be useful to you is that you can play with the client and the server without a cloudlet. You can just start the server directly in the command line with "java" (there arre instructions in some readme I think), and you can input the IP and port where the server is directly in the client in the Settings menu. This is useful if you want to quickly test changes without having to re-create a CSVM file and have to go through the cloudlet.

haiyunaixueye commented 6 years ago

Thank you very much for your answer. Actually, I want to change the data after processed by the server. Do I need to change the code building the csvm file?

I didn't find any code that send the data to Android side in the api folder, so I was confused.

sebastian-echeverria commented 6 years ago

The communication between the Speech client and server happens directly between them. The pycloud API just starts a VM with the server and notifies the client the IP and port of that VM. That is why you can also try communicating between the speech client and the server directly, without having the pycloud API or Manager running.

Thus, the speech server class I mentioned above is the one sending the data directly to the Android client, and the Speech android class I mentioned above receives that data directly. So if you just want to handle the data, work on the Speech android class. If you want to do something before sending the data from the server, work on the server class I mentioned above. To test, you can either recreate the CSVM file and import it into the cloudlet, or just run Speech server on a command line anywhere, and then manually set the Settings of Speech Client to the IP and port of the server.

sebastian-echeverria commented 6 years ago

Closing this unless there are more related questions. Please see #9 for issues working with speech server and the csvm file that have just been fixed.