---
name: "recordTransferTask"
mode: "kit"
versionRequirements:
  - { name: "WearKit", version: "1.0.0" }
  - { name: "@ray-js/ray", version: "1.7.14" }
platform:
  - "iOS"
  - "Android"
async: true
title: "wear.recordTransferTask"
---

## recordTransferTask

> [VERSION] WearKit >= 1.0.0 | @ray-js/ray >= 1.7.14

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Get recording transcription task.

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `deviceId` | `string` | No | - | `1.0.0` | deviceId; if empty, checks whether the current app has a recording task |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `task` | `RecordTransferTask` | `1.0.0` | Recording task information |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Error extension code |
| `errorMsg` | `string` | Error extension message |


### Error Codes

| Error Code | Error Message |
| --- | --- |
| `10001` | Internal error |
| `10048` | Device is not recording |

### Referenced Types

##### `interface` RecordTransferTask

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `state` | `number` | `3.0.0` | Status: 0 Unknown, 1 Recording, 2 Paused, 3 Ended |
| `devId` | `string` | `3.0.0` | Device ID of the current recording |
| `userRecordDuration` | `number` | `3.0.0` | User recording duration, in milliseconds |
| `recordType` | `number` | `3.0.0` | Audio type: 0 call, 1 meeting, 2 simultaneous interpretation |
| `transferType` | `number` | `3.0.0` | Transcription mode: 0 file transcription, 1 real-time transcription |
| `needTranslate` | `boolean` | `3.0.0` | Whether translation is needed |
| `needTts` | `boolean` | `3.0.0` | Whether TTS is required |
| `originalLanguage` | `string` | `3.0.0` | In meeting or call mode, the source language In simultaneous interpretation mode, the left-ear language |
| `targetLanguage` | `string` | `3.0.0` | In meeting or call mode, the target language In simultaneous interpretation mode, the right-ear language |
| `isStarting` | `boolean` | `3.0.0` | Whether starting |
| `isPausing` | `boolean` | `3.0.0` | Whether pausing |
| `isResuming` | `boolean` | `3.0.0` | Whether resuming |
| `isStoping` | `boolean` | `3.0.0` | Whether ending |
| `currentRealTimeAsrId` | `string` | `3.0.0` | The asrId of the ongoing real-time transcription |
| `recordId` | `string` | `3.0.0` | Real-time transcription record ID |
| `audioSource` | `number` | `3.0.0` | Audio input sources; see AudioSource enum values // System audio sources 0-19 SYSTEM_BLUETOOTH_16K_MONO(0), // System Bluetooth, 16 kHz mono SYSTEM_PHONE_MIC_16K_MONO(1), // System MIC, 16 Hz mono // Earphone input sources 20-39 EARPHONE_PRO_16K_MONO(20), // Earphone, 16 kHz mono EARPHONE_PRO_16K_STEREO(21), // Earphone, 16 kHz stereo EARPHONE_PRO_32K_MONO(22), // Card, 32 kHz mono // Card input sources 40-59 NOTE_16K_MONO(40), // Card, 16 kHz mono NOTE_16K_STEREO(41), // Card, 16 kHz stereo |
| `businessType` | `number` | `3.0.0` | Business type: 0 = Note, 1 = Translate |


### Examples

#### Basic usage

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

wear.recordTransferTask({
  deviceId: 'dev',
  success: (result) => {
    console.log('recordTransferTask success', result.task);
  },
  fail: error => {
    console.error(error);
  },
});
```

> See Also：[https://developer.tuya.com/](https://developer.tuya.com/)
