@bddh/starling-dh-picture-client
v1.0.41-beta.1
Published
dh-picture-client
Downloads
889
Keywords
Readme
接入方法
import PictureHuman from '@bddh/starling-dh-picture-client';
const instance = new PictureHuman({
modelUrl: '形象 zip 包',
licenseUrl: 'license的 url',
licenseKey: 'license 的 key',
statusCallback: (status: object) => console.info(JSON.stringify(status)),
canvasId: '#canvas-pic' // 跟下文的 id一致,添加#
});
return (
<canvas id="canvas-pic"></canvas>
)
驱动与回调
音频驱动
textRender({audioBuffer, completed, sample, finishListener});
文本驱动
instance.textRender({
msg: {
token: '填写 appKey, appId 生成的鉴权 token',
text: '使用文本驱动数字人的播报文本',
tts: {
per: 5116,
spd: 5,
pit: 5,
vol: 5
},
interrupted: true
},
finishListener: res => console.info('播报完成', res)
});
// package.json 文件,发公共包时需要改成 "@bddh/starling-web-socket": "^1.0.9",