operateAudioFileSafePath(params: Object)

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);
}

Description

Get audio sharing mini-program compliant path.

Parameters

PropertyTypeRequiredDescription
isGetPathbooleanYesWhether to obtain a secure path true: get false: delete
audioPathstringYesWhen isGetPath is true, audioPath is the filePath obtained via getRecordTransferResultDetail When isGetPath is false, audioPath is the safePath
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({
  isGetPath: true,
  audioPath: '',
  success: (result) => {
    console.log('operateAudioFileSafePath success', result);
  },
  fail: error => {
    console.error(error);
  },
});