Takes captured audio and sends it to the remote peer via UDP channel. More...


Public Member Functions | |
| void | send () throws IOException | 
| Sends audio as payload encapsulated in VoicePDU.   | |
Package Functions | |
| VoicePDUSender (AudioInterface audioInterface, CallContext call) | |
| Constructor for the VoicePDUSender object.   | |
Private Attributes | |
| AudioInterface | audio | 
| CallContext | call | 
| int | voicePduSubclass | 
| byte[] | audioBuffer | 
| long | callStartTimestamp | 
| long | nextDueTimestamp | 
| int | timestamp | 
Takes captured audio and sends it to the remote peer via UDP channel.
Definition at line 15 of file VoicePDUSender.java.
| protocol.VoicePDUSender.VoicePDUSender | ( | AudioInterface | audioInterface, | 
| CallContext | call | ||
| ) |  [package] | 
        
Constructor for the VoicePDUSender object.
| audioInterface | The audio interface | 
| call | The call object | 
Definition at line 32 of file VoicePDUSender.java.
References protocol.VoicePDUSender.audio, protocol.VoicePDUSender.audioBuffer, protocol.VoicePDUSender.call, protocol.VoicePDUSender.callStartTimestamp, audio.AudioInterface.getSampleSize(), protocol.CallContext.getTimestamp(), audio.AudioInterface.getVoicePduSubclass(), protocol.VoicePDUSender.nextDueTimestamp, and protocol.VoicePDUSender.voicePduSubclass.
    {
        this.audio = audioInterface;
        this.call = call;
        
        this.voicePduSubclass = audioInterface.getVoicePduSubclass ();
        this.audioBuffer = new byte[ this.audio.getSampleSize () ];
        this.callStartTimestamp = this.call.getTimestamp ();
        this.nextDueTimestamp = this.callStartTimestamp;
    }
| void protocol.VoicePDUSender.send | ( | ) |   throws IOException      [virtual] | 
        
Sends audio as payload encapsulated in VoicePDU.
Implements audio.AudioInterface.Packetizer.
Definition at line 47 of file VoicePDUSender.java.
References protocol.VoicePDUSender.audio, protocol.VoicePDUSender.audioBuffer, protocol.VoicePDUSender.call, protocol.ProtocolDataUnit.dump(), protocol.VoicePDUSender.nextDueTimestamp, audio.AudioInterface.readWithTimestamp(), protocol.ProtocolDataUnit.sendPayload(), protocol.ProtocolDataUnit.setTimestamp(), protocol.VoicePDUSender.timestamp, and protocol.VoicePDUSender.voicePduSubclass.
    {
        this.audio.readWithTimestamp( this.audioBuffer );
        this.timestamp = (int) this.nextDueTimestamp;
        
        VoicePDU vf = new VoicePDU( this.call, this.voicePduSubclass );
        vf.setTimestamp( this.timestamp );
        vf.sendPayload( this.audioBuffer );
        
        vf.dump( "Outbound Voice" );
        Log.audio( "Sent voice PDU" );
        
        /* Now work out how long to wait...
         */
        this.nextDueTimestamp += 20;
    }
AudioInterface protocol.VoicePDUSender.audio [private] | 
        
Definition at line 17 of file VoicePDUSender.java.
Referenced by protocol.VoicePDUSender.send(), and protocol.VoicePDUSender.VoicePDUSender().
byte [] protocol.VoicePDUSender.audioBuffer [private] | 
        
Definition at line 21 of file VoicePDUSender.java.
Referenced by protocol.VoicePDUSender.send(), and protocol.VoicePDUSender.VoicePDUSender().
CallContext protocol.VoicePDUSender.call [private] | 
        
Definition at line 18 of file VoicePDUSender.java.
Referenced by protocol.VoicePDUSender.send(), and protocol.VoicePDUSender.VoicePDUSender().
long protocol.VoicePDUSender.callStartTimestamp [private] | 
        
Definition at line 22 of file VoicePDUSender.java.
Referenced by protocol.VoicePDUSender.VoicePDUSender().
long protocol.VoicePDUSender.nextDueTimestamp [private] | 
        
Definition at line 23 of file VoicePDUSender.java.
Referenced by protocol.VoicePDUSender.send(), and protocol.VoicePDUSender.VoicePDUSender().
int protocol.VoicePDUSender.timestamp [private] | 
        
Definition at line 24 of file VoicePDUSender.java.
Referenced by protocol.VoicePDUSender.send().
int protocol.VoicePDUSender.voicePduSubclass [private] | 
        
Definition at line 20 of file VoicePDUSender.java.
Referenced by protocol.VoicePDUSender.send(), and protocol.VoicePDUSender.VoicePDUSender().
 1.7.2