I would like to do audio live streaming over WiFi between 2 Android devices.
In order to reduce the audio latency, applying the Oboe C++ library seems to be a right direction to go.
My current structure is to use DatagramPacket to transmit and receive the audio data. The data type of the buffer holding the incoming datagram is byte[]. According to my study, I need to pass the data from the byte[] buffer through JNI (Java Native Interface) and then read the data into a non-blocking queue? (ex: https://github.com/google/oboe/blob/master/samples/RhythmGame/src/main/cpp/utils/LockFreeQueue.h)
If I understand correctly, there is no byte[] data type in C++, so I have to convert the byte[] (jbyteArray in JNI) to the data type (ex: int16_t)?
However, I am not very sure how to implement such a conversion? Or even I am in a wrong direction?
Any suggestions or sample code would be highly appreciated!
Thank you very much!