operateAudioFileSafePath

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

const { operateAudioFileSafePath } = wear;

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

Method signature
operateAudioFileSafePath(params: )

Description

Get audio sharing mini-program compliant path.

Parameters

PropertyTypeRequiredDescriptionWearKit SinceMinimum SDK versions
recordIdstringYesRecording record IDv3.6.0—
isGetPathbooleanYesWhether to obtain a secure path true: get false: delete-
Androidcom.thingclips.smart:thingsmart-bizbundle-wearkit
≥ 7.5.0
audioPathstringYesWhen isGetPath is true, audioPath is the filePath obtained via getRecordTransferResultDetail When isGetPath is false, audioPath is the safePath-
Androidcom.thingclips.smart:thingsmart-bizbundle-wearkit
≥ 7.5.0
complete() => voidNoCompletion callback (executed on both success and failure)-—
success(params: Object) => voidNoCallback on successful API call-—
fail(params: Object) => voidNoFailure callback-—
success callback parameters
PropertyTypeDescription
safePathstringMini Program compliant path. Returns empty when deleting
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Error Code

Error CodeError Message
10001Internal error

Examples

Basic usage

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

wear.operateAudioFileSafePath({
  recordId: '',
  isGetPath: true,
  audioPath: '',
  success: (result) => {
    console.log('operateAudioFileSafePath success', result);
  },
  fail: error => {
    console.error(error);
  },
});