updateParams(params: Object)

Requires:
WearKit≥1.3.0@ray-js/ray≥1.7.82
Platforms:
iOSAndroid
import { wear } from '@ray-js/ray';

const { updateParams } = wear;

// Promise usage
try {
  const res = await updateParams({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Update recording parameters, supports mode switching and dynamic language switching.

Parameters

PropertyTypeRequiredDescription
deviceIdstringYesDevice ID
YesConfiguration
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Error Code

Error CodeError Message
10001Internal error
10041Operation error
10048Device is not recording

Examples

Basic usage

import { wear } from '@ray-js/ray'

wear.updateParams({
  deviceId: 'dev',
  config: {
    businessType: 0,
    audioSource: 0,
    audioSourceList: [0],
    recordType: 0,
    f2fChannel: 0,
    needAsr: true,
    needTranslate: false,
    needTts: false,
    needAmplitude: true,
    needAutoRecognize: false,
    originalLanguage: 'zh',
    targetLanguage: 'en',
    startLivingStatus: 0,
    needRealtimeSummary: true,
    needEchoCancel: false,
  },
  success: () => {
    console.log('updateParams success');
  },
  fail: error => {
    console.error(error);
  },
});