@@ -37,6 +37,7 @@ object SpeechLandmarkerResultParser {
37
37
}
38
38
39
39
private val faceGestureMap = mapOf (
40
+ " null" to " null" ,
40
41
" Brow Down Left" to " browDownLeft" ,
41
42
" Brow Down Right" to " browDownRight" ,
42
43
" Brow Inner Up" to " browInnerUp" ,
@@ -100,21 +101,21 @@ object SpeechLandmarkerResultParser {
100
101
101
102
val idleConfidence = blendshapes.getValue(" neutral" )
102
103
val moveNorthConfidence =
103
- blendshapes.getValue (faceGestureMap.getValue(properties.moveNorthGesture))
104
+ blendshapes.getOrDefault (faceGestureMap.getValue(properties.moveNorthGesture), 0.0F )
104
105
val moveSouthConfidence =
105
- blendshapes.getValue (faceGestureMap.getValue(properties.moveSouthGesture))
106
+ blendshapes.getOrDefault (faceGestureMap.getValue(properties.moveSouthGesture), 0.0F )
106
107
val moveEastConfidence =
107
- blendshapes.getValue (faceGestureMap.getValue(properties.moveEastGesture))
108
+ blendshapes.getOrDefault (faceGestureMap.getValue(properties.moveEastGesture), 0.0F )
108
109
val moveWestConfidence =
109
- blendshapes.getValue (faceGestureMap.getValue(properties.moveWestGesture))
110
+ blendshapes.getOrDefault (faceGestureMap.getValue(properties.moveWestGesture), 0.0F )
110
111
val rotateLeftConfidence =
111
- blendshapes.getValue (faceGestureMap.getValue(properties.rotateLeftGesture))
112
+ blendshapes.getOrDefault (faceGestureMap.getValue(properties.rotateLeftGesture), 0.0F )
112
113
val rotateRightConfidence =
113
- blendshapes.getValue (faceGestureMap.getValue(properties.rotateRightGesture))
114
+ blendshapes.getOrDefault (faceGestureMap.getValue(properties.rotateRightGesture), 0.0F )
114
115
val zoomInConfidence =
115
- blendshapes.getValue (faceGestureMap.getValue(properties.zoomInGesture))
116
+ blendshapes.getOrDefault (faceGestureMap.getValue(properties.zoomInGesture), 0.0F )
116
117
val zoomOutConfidence =
117
- blendshapes.getValue (faceGestureMap.getValue(properties.zoomOutGesture))
118
+ blendshapes.getOrDefault (faceGestureMap.getValue(properties.zoomOutGesture), 0.0F )
118
119
119
120
return when {
120
121
moveNorthConfidence >= properties.moveNorthSensitivity -> LiquidGalaxyManager .State .MOVE_NORTH
0 commit comments