FaceTrackSoundLocalizationComponent

最低版本: 1.0.0最后更新: 2020/3/30

组件功能:

       使用StandardFaceTrackComponent 和 SoundLocationComponent 组件组合而成的组件,用于人脸追踪过程和动态拾音

支持平台

平台是否支持
豹小秘
豹花/大瓶
M平台

参数

属性JS 类型Java类型默认值必填说明最低版本
standardFaceTrackParamStandardFaceTrackParamyesStandardFaceTrack组件的参数1.0.0
soundLocalizationParamSoundLocalizationParamyesSoundLocation组件的参数1.0.0
onFinish(event?: ComponentEvent) => booleanno内部StandardFaceTrackComponent组件的onFinish回调1.0.0
onStatusUpdate(event?: ComponentEvent) => booleanno内部StandardFaceTrackComponent组件的onStatusUpdate回调1.0.0
onSoundLocalizationFinish(event?: ComponentEvent) => booleanno内部SoundLocalizationComponent组件的onFinish回调1.2.8
onSoundLocalizationStatusUpdate(event?: ComponentEvent) => booleanno内部SoundLocalizationComponent组件的onStatusUpdate回调1.2.8

错误码

返回错误描述
ERROR_OPEN_PERSON_DETECT_FAILED-32600004获取人脸数据失败

状态码

返回状态描述
STATUS_TRACK_SUCCESS32720001焦点跟随成功
STATUS_TRACK_END32720003焦点跟随结束

 

示例代码:

this.soundLocalizationParam = new SoundLocalizationParam(angle);

this.standardFaceTrackParam = new StandardFaceTrackParam(this.personId);

<FaceTrackSoundLocalizationComponent

    onStatusUpdate={this.onStatusUpdate}

    onFinish={this.onFaceTrackFinish}

    soundLocalizationParam={this.soundLocalizationParam}

    standardFaceTrackParam={this.standardFaceTrackParam}

/>

public onStatusUpdate = (event?: ComponentEvent): boolean => {

    console.log('HomeViewModel', 'onStatusUpdate event: ', event);

    if (event) {

        switch (event.status) {

            case ComponentStatusConst.STATUS_TRACK_SUCCESS:

                return true;

            case ComponentStatusConst.STATUS_TRACK_END:

                return true;

        }

    }

    return false;

};

public onFaceTrackFinish = (event?: ComponentEvent): boolean => {

    return true;

};