java - Some seconds delay on starting sending Voip with Android.net.rtp -
i implemented android app uses voip android.net.rtp library. gets voice device microphone , sends in voip (to android or pc receiver). problem on devices voip trasmission start after 2–3 seconds. don't mean there delay of 2–3 seconds in delivering packets, mean first 2–3 seconds of voice not sended. after 2–3 seconds works properly. strange thing happens on android device, , not problem of device performance or android version. example happens on old device , in new one, while doesn't happen in old device , in new one… thought android service/functionality delays mic capture, didn't find out @ moment…
in following, code use send voip, classical code:
myaudiostream = new audiostream(myipaddress); myaudiostream.setcodec(audiocodec.pcmu); myaudiogroup = new audiogroup(); myaudiomanager = (audiomanager) mycontext.getsystemservice(context.audio_service); myaudiogroup.setmode(rtpstream.mode_send_only); myaudiostream.join(null); myaudiostream.setmode(rtpstream.mode_send_only); myaudiostream.associate(ipaddress_receiver, port_receiver); myaudiostream.join(myaudiogroup); myaudiomanager.setmode(audiomanager.mode_in_communication); myaudiomanager.setspeakerphoneon(false); myaudiomanager.setmicrophonemute(false);
check if can disable ice and/or stun in android.net.rtp. these responsible delay @ media setup.
Comments
Post a Comment