OK, so I've made some progress on this project.
- I have figured out how the Audio Streaming APIs work on the 1.5 SDK.
- I have obtained a G 711 speech codec in Java which runs on Android. This was taken from the 'sipdroid' VoIP client.
- I have been able to stream a pre-recorded PCM voice file to the emulator via UDP and play it using AudioTrack.
- I have figured out how to use the jLibRtp RTP stack in a Java program. There is a port of the same stack by HSC for Android. So I guess it should work there also, but, I must still test it out.
So, it looks like most of the pieces of the puzzle are in place. However, while using AudioRecord and UDP on the emulator, I have encountered the following problems.
- On the emulator, I instantiate AudioRecord with a sampling rate of 8000Hz and an encoding of 16BIT PCM. This works fine. However, when I try to run the same code on a device, the AudioRecord object does not get created. Looks like I will have to experiment with different sampling rates and buffer sizes. Strange, huh?
- To test the sending and receiving of PCM data, I built a small Java applet that streamed the PCM data to the emulator. I setup proper port redirections. I am able to receive the data in the emulator, but, when I try to send data OUT from the emulator, nothing happens.
Looks like once these problems are sorted out, we are good to go!!!
interesting, but funny how could you have got that far (applet to emulator), but the emulator cannot send out? have you tried using a real device instead of emulator. what error messages, if any do you get? also, what does the ddms logger say? could you send me your email address?
ReplyDeletethe fundamental problem is real-time, you're tests involve sending a pre-recorded file.
ReplyDeletein 1.5 sdk they hardcoded one sample rate 8000/16/1. Just look into android sources
ReplyDeletedid you investigate audio latency? did you get some progress in this area?
ReplyDelete@kevin: this is my email ID:
ReplyDeleteearlenceferns@gmail.com
@oleksander:
there are lots of problems with the audio APIs in 1.5 I am trying to work around these problems.
I have three different phones, tell me if you want me to test some of this on any of them (ADP1, Google ION, HTC Hero).
ReplyDelete@Gunnar - thanks, I will send some APKs in some time :)
ReplyDeleteHello, nice work,can you post your code? or can you make a tutorial explaining how to do it?,
ReplyDeleteI have managed to use AutdioTrack and AudioRecord but can't send the packets over JLibRTP. thanks maxsap