Class AudioChannel


  • public class AudioChannel
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      AudioChannel​(javax.media.MediaLocator locator, java.lang.String localIpAddress, java.lang.String remoteIpAddress, int localPort, int remotePort, javax.media.Format format, JingleMediaSession jingleMediaSession)
      Creates an Audio Channel for a desired jmf locator.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      void setTrasmit​(boolean active)
      Set transmit activity.
      java.lang.String start()
      Starts the transmission.
      void stop()
      Stops the transmission if already started.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AudioChannel

        public AudioChannel​(javax.media.MediaLocator locator,
                            java.lang.String localIpAddress,
                            java.lang.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 java.lang.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​(java.lang.String[] args)