• Post Reply Bookmark Topic Watch Topic
  • New Topic

Voice calling in android using udp sockets

 
Muhammad Abubakar Afzal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey salam!
i am beginner so bear with me   
i have implemented text chat using sockets with server side php api by getting help from tutorials.
now i want to add voice chat. Can i send udp packets from android phone to another phone for voice chat.?
i know i cannot do it directly so first i have to send that packet to php api that will be sent to second phone ?
is it right approach ? if not then tell me what should i do or please refer me some book for this purpose.
thanks in advance.
Screenshot_51.png
[Thumbnail for Screenshot_51.png]
this is my api that is being used for text chatting
Screenshot_1.png
[Thumbnail for Screenshot_1.png]
this is text chat
 
Tim Moores
Saloon Keeper
Posts: 3326
61
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're unlikely to be able to send packets directly from one phone to the other via a mobile network, so unless you want to limit the app to phones connected via WiFi, you'll likely need an intermediary server.

Have you thought about how to convert audio to data and back yet? That involves some interesting challenges like compression, data rate limits, quality etc.
 
Muhammad Abubakar Afzal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so far i am able to send or recieve packets to http api from android... after that i guess i have to just record with AudioRecord and send binary data and recieve that and play that with AudioTrack. is is right approach ?
 
Ron McLeod
Saloon Keeper
Posts: 1287
143
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you wanting to stream audio in real-time between users, or record a message, transfer it to the other users, and then play it?
 
Muhammad Abubakar Afzal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
umm i want to stream audio in real time.
But suggest me what will more be easy :/
thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!