• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Voice calling in android using udp sockets

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 7585
176
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Marshal
Posts: 4501
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
umm i want to stream audio in real time.
But suggest me what will more be easy :/
thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic