getAudioImportStatus(params: Object)

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

const { getAudioImportStatus } = wear;

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

Description

Get audio import status.

Parameters

PropertyTypeRequiredDescription
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
statusnumberImport status 0: Not started 1: Importing 2: Completed 3: Interrupted (error occurred, entire flow stopped)
errorCodenumberError code (used when status = 3) Corresponds to code in FileImportStatus
errorMessagestringError message (used when status = 3) Corresponds to msg in FileImportStatus
totalFileCountnumberTotal number of files
successCountnumberNumber of files imported successfully
List of files that failed to import (failed files are skipped) Each failed file includes the filename and reason
timestampnumberTimestamp
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.getAudioImportStatus({
  success: (result) => {
    console.log('getAudioImportStatus success', result);
  },
  fail: error => {
    console.error(error);
  },
});