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

## startRecordTransfer

> [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

Start recording with transcription.

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `deviceId` | `string` | Yes | - | `1.0.0` | Device ID |
| `config` | `StartRecordTransferConfig` | Yes | - | `1.0.0` | Configuration |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `() => void` | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### 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 |
| `10002` | Device PID is not associated with an Agent |
| `10021` | Timeout |
| `10041` | Operation error |
| `10042` | Already in started state |
| `10046` | Request already in progress |
| `10047` | Device is already recording |
| `10061` | Device error |
| `10062` | Device does not support the recording control dpCode |
| `10063` | DP value error |
| `10064` | Device not fully connected |
| `10071` | Audio format error |
| `10073` | Audio engine initialization failed |
| `10081` | Payment required |
| `10082` | Bluetooth connection error |
| `10083` | Device offline |

### Referenced Types

##### `interface` StartRecordTransferConfig

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `recordType` | `number` | `1.0.0` | Recording type: 0 call, 1 meeting, 2 simultaneous interpretation, 3 face-to-face (F2F) translation |
| `controlTimeout` | `number` | `1.0.0` | DP control timeout, in seconds |
| `recordChannel` | `number` | `1.1.3` | Recording channel: 0 BLE (opus), 1 BT, 2 microphone Default is 0 to maintain backward compatibility |
| `f2fChannel` | `number` | `1.1.3` | Used only when recordType == 3 (confirm the data source direction for face-to-face translation) 0: default  1: left  2: right |
| `dataTimeout` | `number` | `1.0.0` | Streaming timeout, in seconds |
| `transferType` | `number` | `1.0.0` | Transcription mode: 0 file transcription, 1 real-time transcription. Simultaneous interpretation uses real-time transcription; setting 0 has no effect |
| `needTranslate` | `boolean` | `1.0.0` | Whether translation is required. Simultaneous interpretation requires translation; setting false has no effect |
| `originalLanguage` | `string` | `1.0.0` | In meeting or call mode, the source language In simultaneous interpretation mode, the left-ear language |
| `targetLanguage` | `string` | `1.0.0` | In meeting or call mode, the target language In simultaneous interpretation mode, the right-ear language |
| `agentId` | `string` | `1.0.0` | Agent ID |
| `ttsEncode` | `number` | `1.1.7` | (Deprecated) TTS stream encoding; after encoding, the stream is written to the headset device 0: opus_silk  1: opus_celt |
| `ttsConfig` | `TtsConfig` | `1.4.0` | TTS configuration (new) |
| `needTts` | `boolean` | `1.1.7` | Whether TTS is required. true: required  false: not required |
| `recordTransfer3Aconfig` | `RecordTransfer3AConfig` | `1.2.2` | 3A configuration |

##### `interface` TtsConfig

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `devId` | `string` | `1.4.0` | Device ID When the output source is the device, you must send the device ID; pass empty for BT and MIC channels |
| `ttsOutput` | `number` | `1.4.0` | TTS output source 0: default (TTS disabled) 1: system MIC channel 2: system BT channel 3: device |
| `ttsEncode` | `number` | `1.4.0` | TTS encoding 0: default encoding (used when the output source is MIC or Bluetooth) 1: opus_silk (returned when the output source is Pro earbuds and the received audio stream is opus_silk) 2: opus_celt (returned when the output source is Pro earbuds and the received audio stream is opus_celt) |
| `ttsOutputChannel` | `number` | `1.4.0` | TTS output channel 0: default channel (both ears) 1: left ear 2: right ear |

##### `interface` RecordTransfer3AConfig

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `rnAnsEnable` | `boolean` | `1.3.0` | Whether RN noise reduction is required |
| `ansEnable` | `boolean` | `1.2.2` | Whether noise reduction is required |
| `ansLevel` | `number` | `1.2.2` | Noise reduction level: 0 low, 1 medium, 2 high, 3 very high |
| `agcEnable` | `boolean` | `1.2.2` | Whether gain is required |
| `aecEnable` | `boolean` | `1.2.2` | Whether to enable echo cancellation |


### Examples

#### Basic usage

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

wear.startRecordTransfer({
  deviceId: 'dev',
  config: {
    recordType: 0,
    controlTimeout: 0,
    recordChannel: 0,
    f2fChannel: 0,
    dataTimeout: 0,
    transferType: 0,
    needTranslate: false,
    originalLanguage: 'zh',
    targetLanguage: 'en',
    needTts: false,
  },
  success: () => {
    console.log('startRecordTransfer success');
  },
  fail: error => {
    console.error(error);
  },
});
```

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