onFaceInfo

Reports face information processed by the voice driver plugin.

onFaceInfo?(outFaceInfo: string): void;

Parameters

outFaceInfo
Output parameter. A JSON string of the face information processed by the voice driver plugin, containing the following fields:
  • faces: An array of objects. Each object contains information about a detected face.
  • blendshapes: Object. A set of blendshape coefficients named according to the ARKit standard. Each key-value pair represents a blendshape coefficient. The coefficient is a float in the range [0.0, 1.0].
  • rotation: An array of objects. Head rotation values, including the following key-value pairs with float values in the range [-180.0, 180.0]:
    • pitch: Head pitch angle. Positive when looking down, negative when looking up.
    • yaw: Head yaw angle. Positive when turning left, negative when turning right.
    • roll: Head roll angle. Positive when tilting right, negative when tilting left.
  • timestamp: String. The timestamp of the output result in milliseconds.
Example JSON:{"faces":[{"blendshapes":{"eyeBlinkLeft":0.9, "eyeLookDownLeft":0.0, "eyeLookInLeft":0.0, "eyeLookOutLeft":0.0, "eyeLookUpLeft":0.0,"eyeSquintLeft":0.0, "eyeWideLeft":0.0, "eyeBlinkRight":0.0, "eyeLookDownRight":0.0, "eyeLookInRight":0.0,"eyeLookOutRight":0.0, "eyeLookUpRight":0.0, "eyeSquintRight":0.0, "eyeWideRight":0.0, "jawForward":0.0,"jawLeft":0.0, "jawRight":0.0, "jawOpen":0.0, "mouthClose":0.0, "mouthFunnel":0.0, "mouthPucker":0.0,"mouthLeft":0.0, "mouthRight":0.0, "mouthSmileLeft":0.0, "mouthSmileRight":0.0, "mouthFrownLeft":0.0,"mouthFrownRight":0.0, "mouthDimpleLeft":0.0, "mouthDimpleRight":0.0, "mouthStretchLeft":0.0, "mouthStretchRight":0.0,"mouthRollLower":0.0, "mouthRollUpper":0.0, "mouthShrugLower":0.0, "mouthShrugUpper":0.0, "mouthPressLeft":0.0,"mouthPressRight":0.0, "mouthLowerDownLeft":0.0, "mouthLowerDownRight":0.0, "mouthUpperUpLeft":0.0, "mouthUpperUpRight":0.0,"browDownLeft":0.0, "browDownRight":0.0, "browInnerUp":0.0, "browOuterUpLeft":0.0, "browOuterUpRight":0.0,"cheekPuff":0.0, "cheekSquintLeft":0.0, "cheekSquintRight":0.0, "noseSneerLeft":0.0, "noseSneerRight":0.0,"tongueOut":0.0},"rotation":{"pitch":30.0, "yaw":25.5, "roll":-15.5},}],"timestamp":"654879876546"}

Return Values

  • true: Successfully parsed the face information JSON.
  • false: Failed to parse the face information JSON.