Class AudioChannel


  • public class AudioChannel
    extends Object
    An Easy to use Audio Channel implemented using JMF. It sends and receives jmf for and from desired IPs and ports. Also has a rport Symetric behavior for better NAT Traversal. It send data from a defined port and receive data in the same port, making NAT binds easier.

    Send from portA to portB and receive from portB in portA.

    Sending portA ---> portB

    Receiving portB ---> portA

    Transmit and Receive are interdependence. To receive you MUST transmit.
    • Constructor Detail

      • AudioChannel

        public AudioChannel​(javax.media.MediaLocator locator,
                            String localIpAddress,
                            String remoteIpAddress,
                            int localPort,
                            int remotePort,
                            javax.media.Format format,
                            JingleMediaSession jingleMediaSession)
        Creates an Audio Channel for a desired jmf locator. For instance: new MediaLocator("dsound://")
        Parameters:
        locator - media locator
        localIpAddress - local IP address
        remoteIpAddress - remote IP address
        localPort - local port number
        remotePort - remote port number
        format - audio format
        jingleMediaSession - the jingle media session.
    • Method Detail

      • start

        public String start()
        Starts the transmission. Returns null if transmission started ok. Otherwise it returns a string with the reason why the setup failed. Starts receive also.
        Returns:
        result description
      • stop

        public void stop()
        Stops the transmission if already started. Stops the receiver also.
      • setTrasmit

        public void setTrasmit​(boolean active)
        Set transmit activity. If the active is true, the instance should transmit. If it is set to false, the instance should pause transmit.
        Parameters:
        active - active state
      • main

        public static void main​(String[] args)