Version 1.5APIs subject to change!

multiverse.server.plugins
Class VoicePlugin

java.lang.Object
  extended by multiverse.server.engine.EnginePlugin
      extended by multiverse.server.plugins.VoicePlugin
All Implemented Interfaces:
MessageCallback, StatusMapCallback, multiverse.server.network.ClientConnection.AcceptCallback, multiverse.server.network.ClientConnection.MessageCallback, ObjectTracker.NotifyReactionRadiusCallback, ObjectTracker.RemoteObjectFilter, VoiceSender

public class VoicePlugin
extends EnginePlugin
implements VoiceSender, multiverse.server.network.ClientConnection.AcceptCallback, multiverse.server.network.ClientConnection.MessageCallback, ObjectTracker.NotifyReactionRadiusCallback, ObjectTracker.RemoteObjectFilter

Plugin to handle voice channels


Nested Class Summary
static class VoicePlugin.VoiceConManager
          A class with locking to manage the Maps and Sets of connections.
 
Nested classes/interfaces inherited from class multiverse.server.engine.EnginePlugin
EnginePlugin.DeleteHook, EnginePlugin.DeleteSubObjHook, EnginePlugin.GenerateSubObjectHook, EnginePlugin.GetPropertyMessage, EnginePlugin.LoadHook, EnginePlugin.LoadSubObjHook, EnginePlugin.PluginActivateHook, EnginePlugin.PluginStateMessage, EnginePlugin.SaveHook, EnginePlugin.SaveSubObjHook, EnginePlugin.SetPropertyMessage, EnginePlugin.SubObjData, EnginePlugin.TransferFilter, EnginePlugin.TransferObjectMessage, EnginePlugin.UnloadHook, EnginePlugin.UnloadSubObjHook
 
Field Summary
protected static boolean allowVoiceBots
          If this is true, we subscribe to login messages and pass on login notifications.
static CountLogger.Counter countAllocateVoiceReceived
           
static CountLogger.Counter countAllocateVoiceSent
           
static CountLogger.Counter countDeallocateVoiceReceived
           
static CountLogger.Counter countDeallocateVoiceSent
           
static CountLogger.Counter countSendLoginStatus
           
protected static boolean createGroupWhenReferenced
          If this is true, we'll synthesize the group and/or group member when an auth packet comes in.
static TimeHistogram dataSendHistogram
           
static int lengthBytes
          There are two bytes in the length prefixed to a TCP message
protected  java.util.concurrent.locks.Lock lock
           
static int maxVoiceChannels
          The server is supposed to run things so no client ever has more than this number of voice channels.
static byte opcodeAggregatedData
          An aggregated data packet contains a number of data packets.
static byte opcodeAllocateCodec
          Allocate a voice.
static byte opcodeAllocatePositionalCodec
          This has exactly the same payload as AllocateCodec, but says that the voice should be positional.
static byte opcodeAuthenticate
          The authenticate packet must be the first one received by the voice plugin on any new connection from a client.
static byte opcodeData
          A data packet, consisting of a 4-byte header followed by the bytes of the data frame.
static byte opcodeDeallocate
          Deallocate the voice number.
static int opcodeHighest
           
static byte opcodeLoginStatus
          An opcode sent exclusively from the server to the client, and used only to support synchronization between voice bots and test clients.
static java.lang.String[] opcodeNames
          Used in logging messages
static byte opcodeReconfirmCodec
          This has exactly the same payload as AllocateCodec, but is with lossy transports like UDP to send the opcode parameters every second or so.
static byte opcodeVoiceUnallocated
          All voices start out unallocated
protected  PerceptionFilter perceptionFilter
           
protected  long perceptionSubId
           
static TimeHistogram processPacketHistogram
           
static boolean runHistograms
           
static int[] speexNarrowBandFrameSize
          This array is indexed by Speex narrow-band mode, and gives the narrow-band frame size for that mode.
static int[] speexWideBandFrameSize
           
static TimeHistogram voiceAllocHistogram
           
static TimeHistogram voiceDeallocHistogram
           
static int[] voiceMsgSize
          This gives the number of bytes in the message excluding the length, except for the data case, where it gives the number of bytes in the header, but not including the data itself
static byte voicePacketHeaderSize
          All voice packets start with 4 bytes: o 16-bit sequence number, increased by one for each successive transmission for this voice.
 
Fields inherited from class multiverse.server.engine.EnginePlugin
deleteSubObjectSubscription, dumpAllThreadSubscription, dumpAllThreadSubscriptionLock, loadSubObjectSubscription, MSG_TYPE_DUMP_ALL_THREAD_STACKS, MSG_TYPE_GET_PROPERTY, MSG_TYPE_PLUGIN_STATE, MSG_TYPE_SET_PROPERTY, MSG_TYPE_SET_PROPERTY_NONBLOCK, MSG_TYPE_TRANSFER_OBJECT, pluginStateSubscription, propertySubscription, saveSubObjectSubscription, selectionFilter, selectionSubscription, setSubObjectPersistenceSubscription, subObjectSubscription, unloadSubObjectSubscription
 
Fields inherited from interface multiverse.msgsys.MessageCallback
NO_FLAGS, RESPONSE_EXPECTED
 
Constructor Summary
VoicePlugin()
          The VoicePlugin accepts connections from game clients who have been supplied the IP and port number to contact by the initial game system login.
 
Method Summary
 void acceptConnection(multiverse.server.network.ClientConnection con)
           
 void addGroup(long groupOid, VoiceGroup group)
          Inform the VoicePlugin about the existance of a voice group.
protected  void addPerceiverToTracker(long playerOid, VoiceStub stub)
           
protected  void addToPerceptionFilter(long playerOid)
           
 void connectionReset(multiverse.server.network.ClientConnection con)
          Close record stream if it's open, deallocate all voices in use by the connection, and remove the listeners ??? TBD: Need to remove connection from a whole bunch of data structures.
protected  VoiceStub createVoiceStub(long playerOid)
           
static int encodedFrameSizeForMode(int mode, boolean wideBand)
          Return the total frame size for narrow or wide-band mode given
static int encodedFrameSizeFromFirstByte(byte b)
          Return the frame size for the band/mode specified by the first byte of the Speex frame
protected  void expungeVoiceClient(long playerOid)
           
protected  void expungeVoiceClient(long playerOid, VoiceConnection con)
           
protected  VoiceGroup findVoiceGroup(long groupOid)
          Return the group for groupOid, having checked to see that the group exists and contains the player.
 java.lang.String formatCon(multiverse.server.network.ClientConnection con)
           
 VoiceConnection getConnectionData(multiverse.server.network.ClientConnection con)
           
 Point getCurrentLoc(long memberOid)
          Get the current location of the member.
static VoicePlugin getInstance()
           
protected  GroupMember getPlayerMember(long playerOid)
           
 ProximityTracker getTracker(long instanceOid, boolean mustAlreadyExist)
           
 ProximityTracker getTrackerOrNull(long instanceOid)
           
static short incSeqNum(short original)
          Increment the short seqNum so that it wraps around properly.
static short incSeqNum(short original, int byWhat)
          Increment the short seqNum so that it wraps around properly.
protected  void maybeRemoveFromTracker(long playerOid, long instanceOid)
           
 void notifyReactionRadius(long listenerOid, long speakerOid, boolean inRadius, boolean wasInRadius)
          This callback is invoked by the ProximityTracker to tell us who is in audible range of whom.
 boolean objectShouldBeTracked(long objectOid, PerceptionMessage.ObjectNote note)
          This callback is invoked by the ProximityTracker to determine if a candidate remote object should be tracked.
 void onActivate()
          for developers extending the EnginePlugin object, it may be easier to use the onActivate() method which gets called when the plugin is being activated by the Engine.
static java.lang.String opcodeString(byte opcode)
          Return a string representation of the opcode number
protected  java.io.BufferedOutputStream openSpeexVoiceFile(long oid)
           
 void processAuthenticationPacket(VoiceConnection playerCon, multiverse.server.network.MVByteBuffer buf)
          Check to see of the auth packet contains the proper credentials, and if so, create a group member in the specified group.
 void processPacket(multiverse.server.network.ClientConnection con, multiverse.server.network.MVByteBuffer buf)
          The buf limit is the size.
protected  void removeFromPerceptionFilter(long playerOid)
           
 void removeGroup(long groupOid)
          Remove a group.
 void removePlayerFromGroup(VoiceConnection playerCon)
          Remove the player identified by the argument from the group it belongs to.
 void removeTracker(long instanceOid)
           
 void sendAllocateVoice(VoiceConnection speaker, VoiceConnection listener, byte voiceNumber, boolean positional)
          Send a message which tells the client that the server has established a voice channel to the client, identified by the given voiceNumber, using an overloading of sendAllocateVoice in which whether the voice channel will be treated positionally is determined by the boolean positional arg.
 void sendAllocateVoice(VoiceConnection speaker, VoiceConnection listener, byte voiceNumber, byte opcode)
          Send a message which tells the client that the server has established a voice channel to the client, identified by the given voiceNumber, using an overloading of sendAllocateVoice in which the positional boolean is replaced by the appropriate voice allocate opcode.
 void sendDeallocateVoice(VoiceConnection speaker, VoiceConnection listener, byte voiceNumber)
          Send a message to the connection deallocating the voice with the given number.
 void sendExtensionMessage(WorldManagerClient.ExtensionMessage msg)
          Send a broadcast ExtensionMessage to anyone who cares.
 void sendLoginStatus(VoiceConnection receiver, long playerOid, boolean login)
           
protected  void sendLoginStatusToReceivers(long playerOid, boolean login)
           
 void sendVoiceFrame(VoiceConnection speaker, VoiceConnection listener, byte opcode, byte voiceNumber, multiverse.server.network.MVByteBuffer sourceBuf, short pktLength)
          Send a voice data message to the client on the voice channel identitified by the voiceNumber.
protected  void writeSpeexData(java.io.BufferedOutputStream recordSpeexStream, byte[] buf, int startIndex, int byteCount)
          Write a single Speex frame to the stream, from the byte array
 
Methods inherited from class multiverse.server.engine.EnginePlugin
activate, createMBeanInstance, createSubscription, getHookManager, getMessageHandler, getName, getObjectLockManager, getObjectProperties, getObjectProperties, getObjectProperty, getPercentCPULoad, getPluginInfo, getPluginNamespaces, getPluginState, getPluginStatus, getPluginType, getPropertyImpl, getStatusMap, handleMessage, handleMessageImpl, logDepsOutstanding, processKeysAndValues, registerActivateHook, registerDeleteHook, registerLoadHook, registerPluginNamespace, registerPluginNamespaces, registerPluginNamespaces, registerPluginNamespaces, registerSaveHook, registerTransferHook, registerUnloadHook, sendSubObjectResponse, sendSubObjectResponse, sendSubObjectResponse, setMessageHandler, setName, setObjectProperties, setObjectProperties, setObjectPropertiesNoResponse, setObjectPropertiesNoResponse, setObjectProperty, setObjectPropertyNoResponse, setPercentCPULoad, setPluginInfo, setPluginType, setPropertyImpl, transferObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

voicePacketHeaderSize

public static final byte voicePacketHeaderSize
All voice packets start with 4 bytes: o 16-bit sequence number, increased by one for each successive transmission for this voice. o 8-bit opcode byte o 8-bit voice number

See Also:
Constant Field Values

opcodeVoiceUnallocated

public static final byte opcodeVoiceUnallocated
All voices start out unallocated

See Also:
Constant Field Values

opcodeAuthenticate

public static final byte opcodeAuthenticate
The authenticate packet must be the first one received by the voice plugin on any new connection from a client. The voice plugin maintains a map of the IP/port number to the oid of the client, used to validate traffic. The packet contains the string authentication token, the oid of the player; the oid of the group the player is signing up to; and a bool saying whether voice packets from this connection should be sent back to this connection. Total size is 2 + 1 + 1 + 8 + 8 + 1 + 4 = 25 bytes plus number of bytes in the authToken string.

See Also:
Constant Field Values

opcodeAllocateCodec

public static final byte opcodeAllocateCodec
Allocate a voice. Apart from the header, the payload is the 8-byte OID of the object emitting the sound. Size is 12 bytes.

See Also:
Constant Field Values

opcodeAllocatePositionalCodec

public static final byte opcodeAllocatePositionalCodec
This has exactly the same payload as AllocateCodec, but says that the voice should be positional.

See Also:
Constant Field Values

opcodeReconfirmCodec

public static final byte opcodeReconfirmCodec
This has exactly the same payload as AllocateCodec, but is with lossy transports like UDP to send the opcode parameters every second or so. Size is 12 bytes.

See Also:
Constant Field Values

opcodeDeallocate

public static final byte opcodeDeallocate
Deallocate the voice number. A voice number must be deallocated before it can be reused. There is no additional data. This is used both when a client signs off, and when the microphone goes quiet. A total of 4 bytes.

See Also:
Constant Field Values

opcodeData

public static final byte opcodeData
A data packet, consisting of a 4-byte header followed by the bytes of the data frame. All data messages _from_ the client supply the microphone number as the voice number. Since for the time being we support exactly one microphone, the voice numbers in messages from the client are always zero. Size is 4 bytes plus the codec frame playload, typically 28 bytes for 11000bps.

See Also:
Constant Field Values

opcodeAggregatedData

public static final byte opcodeAggregatedData
An aggregated data packet contains a number of data packets. It starts with a standard header, and has an additional byte arg which is the number of data packets contained therein. The first contained data frame has a seqnum equal to the seqnum of the ggregated data packet, and are numbered sequentially thereafter. So the seqnum of the next packet after an aggregated data packet is larger by the number of data frames in the packet. Each data packet inside an aggregated data packet starts with a 1-byte length.

See Also:
Constant Field Values

opcodeLoginStatus

public static final byte opcodeLoginStatus
An opcode sent exclusively from the server to the client, and used only to support synchronization between voice bots and test clients. It contains the standard header plus the oid of the player whose login status has changed. The voiceNumber is 1 if it's a login, and 0 if it's a logout.

See Also:
Constant Field Values

opcodeHighest

public static final int opcodeHighest
See Also:
Constant Field Values

opcodeNames

public static java.lang.String[] opcodeNames
Used in logging messages


voiceMsgSize

public static int[] voiceMsgSize
This gives the number of bytes in the message excluding the length, except for the data case, where it gives the number of bytes in the header, but not including the data itself


lengthBytes

public static int lengthBytes
There are two bytes in the length prefixed to a TCP message


speexNarrowBandFrameSize

public static int[] speexNarrowBandFrameSize
This array is indexed by Speex narrow-band mode, and gives the narrow-band frame size for that mode.


speexWideBandFrameSize

public static int[] speexWideBandFrameSize

maxVoiceChannels

public static int maxVoiceChannels
The server is supposed to run things so no client ever has more than this number of voice channels.


countSendLoginStatus

public static CountLogger.Counter countSendLoginStatus

countAllocateVoiceReceived

public static CountLogger.Counter countAllocateVoiceReceived

countDeallocateVoiceReceived

public static CountLogger.Counter countDeallocateVoiceReceived

countAllocateVoiceSent

public static CountLogger.Counter countAllocateVoiceSent

countDeallocateVoiceSent

public static CountLogger.Counter countDeallocateVoiceSent

runHistograms

public static boolean runHistograms

processPacketHistogram

public static TimeHistogram processPacketHistogram

dataSendHistogram

public static TimeHistogram dataSendHistogram

voiceAllocHistogram

public static TimeHistogram voiceAllocHistogram

voiceDeallocHistogram

public static TimeHistogram voiceDeallocHistogram

createGroupWhenReferenced

protected static boolean createGroupWhenReferenced
If this is true, we'll synthesize the group and/or group member when an auth packet comes in. Used only for testing.


allowVoiceBots

protected static boolean allowVoiceBots
If this is true, we subscribe to login messages and pass on login notifications.


perceptionFilter

protected PerceptionFilter perceptionFilter

perceptionSubId

protected long perceptionSubId

lock

protected transient java.util.concurrent.locks.Lock lock
Constructor Detail

VoicePlugin

public VoicePlugin()
The VoicePlugin accepts connections from game clients who have been supplied the IP and port number to contact by the initial game system login. The client initiates the connection, and must immediately thereafter send it's codec parameters. At that point, the client can send voice frames from the microphone, and the voice plugin forwards those frames to listeners. The process by which a set of listeners to any voice is established is game-dependent. But the sequence of events is fixed: - The listener allocates a "voice channel" to receive frames - The listener initializes the codec parameters for the new voice channel to be those associated with the channel. - As frames are received from clients, they are forwarded to listeners. At any point, for each client, there is a (possibly null) set of listeners; this is maintained in the voice group to which the player belongs.

Method Detail

getInstance

public static VoicePlugin getInstance()

onActivate

public void onActivate()
Description copied from class: EnginePlugin
for developers extending the EnginePlugin object, it may be easier to use the onActivate() method which gets called when the plugin is being activated by the Engine. this is an alternative to calling registerActivateHook()

Overrides:
onActivate in class EnginePlugin

acceptConnection

public void acceptConnection(multiverse.server.network.ClientConnection con)
Specified by:
acceptConnection in interface multiverse.server.network.ClientConnection.AcceptCallback

createVoiceStub

protected VoiceStub createVoiceStub(long playerOid)

maybeRemoveFromTracker

protected void maybeRemoveFromTracker(long playerOid,
                                      long instanceOid)

sendLoginStatusToReceivers

protected void sendLoginStatusToReceivers(long playerOid,
                                          boolean login)

getCurrentLoc

public Point getCurrentLoc(long memberOid)
Get the current location of the member. Used only for positional groups.

Returns:
The member's current location.

addPerceiverToTracker

protected void addPerceiverToTracker(long playerOid,
                                     VoiceStub stub)

getPlayerMember

protected GroupMember getPlayerMember(long playerOid)

notifyReactionRadius

public void notifyReactionRadius(long listenerOid,
                                 long speakerOid,
                                 boolean inRadius,
                                 boolean wasInRadius)
This callback is invoked by the ProximityTracker to tell us who is in audible range of whom. If the target oid, which is the listener, is in a positional group, we use it to maintain the set of eligible speakers and listeners for the positional group.

Specified by:
notifyReactionRadius in interface ObjectTracker.NotifyReactionRadiusCallback

objectShouldBeTracked

public boolean objectShouldBeTracked(long objectOid,
                                     PerceptionMessage.ObjectNote note)
This callback is invoked by the ProximityTracker to determine if a candidate remote object should be tracked.

Specified by:
objectShouldBeTracked in interface ObjectTracker.RemoteObjectFilter

getTracker

public ProximityTracker getTracker(long instanceOid,
                                   boolean mustAlreadyExist)

getTrackerOrNull

public ProximityTracker getTrackerOrNull(long instanceOid)

removeTracker

public void removeTracker(long instanceOid)

processPacket

public void processPacket(multiverse.server.network.ClientConnection con,
                          multiverse.server.network.MVByteBuffer buf)
The buf limit is the size.

Specified by:
processPacket in interface multiverse.server.network.ClientConnection.MessageCallback

writeSpeexData

protected void writeSpeexData(java.io.BufferedOutputStream recordSpeexStream,
                              byte[] buf,
                              int startIndex,
                              int byteCount)
Write a single Speex frame to the stream, from the byte array


processAuthenticationPacket

public void processAuthenticationPacket(VoiceConnection playerCon,
                                        multiverse.server.network.MVByteBuffer buf)
Check to see of the auth packet contains the proper credentials, and if so, create a group member in the specified group.


addToPerceptionFilter

protected void addToPerceptionFilter(long playerOid)

removeFromPerceptionFilter

protected void removeFromPerceptionFilter(long playerOid)

removePlayerFromGroup

public void removePlayerFromGroup(VoiceConnection playerCon)
Remove the player identified by the argument from the group it belongs to.

Parameters:
playerCon - The VoiceConnection object corresponding to the player.

findVoiceGroup

protected VoiceGroup findVoiceGroup(long groupOid)
Return the group for groupOid, having checked to see that the group exists and contains the player.


addGroup

public void addGroup(long groupOid,
                     VoiceGroup group)
Inform the VoicePlugin about the existance of a voice group.

Parameters:
groupOid - The oid of the voice group to be added.
group - The voice group to be added.

removeGroup

public void removeGroup(long groupOid)
Remove a group.

Parameters:
groupOid - The oid of the voice group to be removed.

sendAllocateVoice

public void sendAllocateVoice(VoiceConnection speaker,
                              VoiceConnection listener,
                              byte voiceNumber,
                              boolean positional)
Description copied from interface: VoiceSender
Send a message which tells the client that the server has established a voice channel to the client, identified by the given voiceNumber, using an overloading of sendAllocateVoice in which whether the voice channel will be treated positionally is determined by the boolean positional arg.

Specified by:
sendAllocateVoice in interface VoiceSender
Parameters:
speaker - The VoiceConnection object that represents the speaker that will be the source of voice data for the new voice channel.
listener - The VoiceConnection object representing the listener player, whose client will be sent an allocate message followed by voice data messages.
voiceNumber - The number, from 0 - maxVoiceChannels, of the voice channel to be established.
positional - True if the voice should behave as a positional voice.

sendAllocateVoice

public void sendAllocateVoice(VoiceConnection speaker,
                              VoiceConnection listener,
                              byte voiceNumber,
                              byte opcode)
Description copied from interface: VoiceSender
Send a message which tells the client that the server has established a voice channel to the client, identified by the given voiceNumber, using an overloading of sendAllocateVoice in which the positional boolean is replaced by the appropriate voice allocate opcode.

Specified by:
sendAllocateVoice in interface VoiceSender
Parameters:
speaker - The VoiceConnection object that represents the speaker that will be the source of voice data for the new voice channel.
listener - The VoiceConnection object representing the listener player, whose client will be sent an allocate message followed by voice data messages.
voiceNumber - The number, from 0 - maxVoiceChannels, of the voice channel to be established.
opcode - Either VoicePlugin.opcodeAllocatePositional or VoicePlugin.opcodeAllocateNonpositional.

sendDeallocateVoice

public void sendDeallocateVoice(VoiceConnection speaker,
                                VoiceConnection listener,
                                byte voiceNumber)
Send a message to the connection deallocating the voice with the given number.

Specified by:
sendDeallocateVoice in interface VoiceSender
Parameters:
speaker - The VoiceConnection object that represents the speaker that was the source of voice data for the voice channel.
listener - The VoiceConnection object representing the listener player, whose client will be sent the deallocate message.
voiceNumber - The number, from 0 - maxVoiceChannels, of the voice channel to be established.

sendVoiceFrame

public void sendVoiceFrame(VoiceConnection speaker,
                           VoiceConnection listener,
                           byte opcode,
                           byte voiceNumber,
                           multiverse.server.network.MVByteBuffer sourceBuf,
                           short pktLength)
Description copied from interface: VoiceSender
Send a voice data message to the client on the voice channel identitified by the voiceNumber.

Specified by:
sendVoiceFrame in interface VoiceSender
Parameters:
speaker - The VoiceConnection object that represents the speaker that was the source of voice data for the voice channel.
listener - The VoiceConnection object representing the listener player, whose client will be sent the voice data message.
opcode - Either VoicePlugin.opcodeAggregateData or VoicePlugin.opcodeData.
voiceNumber - The number, from 0 - maxVoiceChannels, of the voice channel to be established.
sourceBuf - A byte buffer holding the entire voice message as received from the speaker. The first byte of the message is at index 0 in buf.
pktLength - The number of bytes of message in the buf.

sendLoginStatus

public void sendLoginStatus(VoiceConnection receiver,
                            long playerOid,
                            boolean login)

sendExtensionMessage

public void sendExtensionMessage(WorldManagerClient.ExtensionMessage msg)
Description copied from interface: VoiceSender
Send a broadcast ExtensionMessage to anyone who cares. Used to send "event" messages from the voice groups.

Specified by:
sendExtensionMessage in interface VoiceSender
Parameters:
msg - The ExtensionMessage to send.

openSpeexVoiceFile

protected java.io.BufferedOutputStream openSpeexVoiceFile(long oid)

getConnectionData

public VoiceConnection getConnectionData(multiverse.server.network.ClientConnection con)

formatCon

public java.lang.String formatCon(multiverse.server.network.ClientConnection con)

connectionReset

public void connectionReset(multiverse.server.network.ClientConnection con)
Close record stream if it's open, deallocate all voices in use by the connection, and remove the listeners ??? TBD: Need to remove connection from a whole bunch of data structures.

Specified by:
connectionReset in interface multiverse.server.network.ClientConnection.MessageCallback

expungeVoiceClient

protected void expungeVoiceClient(long playerOid)

expungeVoiceClient

protected void expungeVoiceClient(long playerOid,
                                  VoiceConnection con)

incSeqNum

public static short incSeqNum(short original)
Increment the short seqNum so that it wraps around properly.


incSeqNum

public static short incSeqNum(short original,
                              int byWhat)
Increment the short seqNum so that it wraps around properly.


encodedFrameSizeForMode

public static int encodedFrameSizeForMode(int mode,
                                          boolean wideBand)
Return the total frame size for narrow or wide-band mode given


encodedFrameSizeFromFirstByte

public static int encodedFrameSizeFromFirstByte(byte b)
Return the frame size for the band/mode specified by the first byte of the Speex frame


opcodeString

public static java.lang.String opcodeString(byte opcode)
Return a string representation of the opcode number



Copyright © 2008 The Multiverse Network, Inc.