MOSCalculator
public class MOSCalculator
Utility class for calculating Mean Opinion Score (MOS) and call quality metrics
-
Calculates the Mean Opinion Score (MOS) based on WebRTC statistics
Declaration
Swift
public static func calculateMOS(jitter: Double, rtt: Double, packetsReceived: Int, packetsLost: Int) -> DoubleParameters
jitterJitter in milliseconds
rttRound-trip time in milliseconds
packetsReceivedNumber of packets received
packetsLostNumber of packets lost
Return Value
MOS score in the inclusive range
1.0...5.0, orNaNwhen the inputs are non-finite or the computation overflows. Callers should pair the result withgetQuality(mos:), which mapsNaNto.unknown. -
Determines call quality based on MOS score.
Non-finite inputs (
NaN,±infinity) are reported as.unknown. For finite values the bands are continuous — every non-negative MOS value maps to exactly one rating, with no gaps between bands.Declaration
Swift
public static func getQuality(mos: Double) -> CallQualityParameters
mosMean Opinion Score
Return Value
Call quality rating