Patent ID: 7715404

Claim:
A method for controlling a Voice over Internet Protocol (VoIP) decoder in a communication device, comprising: determining if a packet has been received, and if a packet has been received, determining if a receive error has occurred, and if a receive error has not occurred, setting a counter that counts a number of sequential bad frames to a value of zero; decoding the received packet; and sending the decoded packet to an audio queue for presentation to a user of the communication device, wherein if the receive error is a timeout error and if a timeout error is determined to have occurred, the method further comprises: determining if comfort noise is being generated, wherein if comfort noise is being generated, resetting a bad frame counter to zero; and comparing an output audio queue depth to a target output audio queue depth, wherein if the output audio queue depth is less than the target output audio queue depth, generating a comfort noise frame, otherwise no comfort noise frame is generated, wherein if comfort noise is not being generated, the method further comprises: comparing an output audio queue depth to a minimum output audio queue depth, wherein if the output audio queue depth is equal to or less than the minimum output audio queue depth, determining if a consecutive bad frame counter is less than a maximum number of consecutive bad frames allowed, wherein if the consecutive bad frame counter is less than the maximum number of consecutive bad frames allowed, generating a fill frame; storing the fill frame in the audio queue; and incrementing the consecutive bad frame counter.