I am developing a voip app in ios platform. Now with the app we can speak to each other normally ,but the voice quality is not good enough.It takes me too much time to solve.
There is a mic input demo(https://github.com/fuxx/MicInput).It records your voice simply from mic and playback to headset in time. It'voice quality is very good and it is even better when using the VPIO audiounit instead of the RemoteIO audiounit.
From the mic input demo,you may say a basic voip app is very simple since there are only a little thing to do such as coding,transmit and etc.
But it is not like that at all.When I copy Mic input mode and add the voice coding/decoding(AMR) function, network transmit function(udp),It ends with very poor voice quality.The biggest problem is that the voice is not clear enough.
I try to change the audiounit type from RemoteIO to VPIO but it makes no sense. It's really sucks!
Some ios code files can be download from here:
http://pan.baidu.com/s/1mgwwZsk
RtpPacket.h: add the rtp head in udp packet.
AudioProcessor.h/m: copy the record/playback mode from Mic input demo.
UdpTransmittor.h/m: send/recv the amr packet to or from peer.
AMR codeing/decoding need a complete frame of which length is 320 bytes (8000HZ,1 channel) ,so I use a circular buffer to make it works continuously.
I find the record callback function is not called just right 20ms every times and you may get the 370 bytes at first time but 372 bytes at next time.
Is there anything I can do to improve the voice quality?
Thanks for you concern and reply!!