Android Question Audio Streaming and Server With PHP

Discussion in 'Android Questions' started by Marcos Alves, Dec 31, 2017.

  1. Marcos Alves

    Marcos Alves Active Member Licensed User

    Anybody knows how to use audio functions/library to communicate with other android device using streaming and a server? I know that there is a "walkie talkie" (this tutorial by Erel -> https://www.b4x.com/android/forum/t...reaming-over-wifi-or-bluetooth.30648/#content) - but it's very difficult or even impossible in some networks to create a direct socket with other peer thru internet. A server solution using, for example, php streaming between two android devices could be the ideal solution always, with the bonus of gaining control and visibility over the peers - the basis of a professional communications service... does anybody knows how to do this ? (streaming client/library + php streaming server ?). Thanks!
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The walkie talkie example includes the two relevant client features, sending and receiving the audio stream.

    You can use B4J or PHP to build the server that will sit in the middle.
     
    Peter Simpson likes this.
  3. Marcos Alves

    Marcos Alves Active Member Licensed User

    Thanks @Erel . Do you have some sample code of a php server to interact with b4a audiostrem clent?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    No. Sorry.

    It will be easier to implement with B4J.
     
    Jmu5667 likes this.
  5. Marcos Alves

    Marcos Alves Active Member Licensed User

    Ok, thanks @Erel . I never used B4J but I think that came from you must to be a great tool like b4A and B4i... following your opinion: do you have any sample in B4J of a streaming server... something like: client A - connect server - server has the client B IP also... then, receive streaming from A to B and back from B to A. I know that maybe the best place to put this thread could be B4J forum, but this will be also a tool for Android clients...
    by the way, happy new year and thanks for all these great frameworks!
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    There is no such example. This task is less suitable for a server based on jServer. You will need to implement it with sockets and AsyncStreams.
    Start with this example: https://www.b4x.com/android/forum/threads/72149/#content

    Assuming that you only need to support exactly two clients then you can simplify the solution by listening on two ports with two ServerSockets and then transfer the data between the AsyncStreams (after they are connected).
     
  7. Marcos Alves

    Marcos Alves Active Member Licensed User

    Thanks @Erel , I'll check!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice