# CoworkCaptureSession

A recording in progress (`cowork.capture.record`).

## Properties

### file

```ts
file: string;
```

Workspace-relative path the recording lands at.

***

### id

```ts
id: string;
```

***

### onAudio

```ts
onAudio: (cb) => () => void;
```

Live audio (`live: true`): 16 kHz mono Int16 frames of 20 ms. Returns the unsubscribe.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `cb` | (`frame`) => `void` |

#### Returns

() => `void`

***

### onStop

```ts
onStop: (cb) => () => void;
```

Called once when the recording ends — Stop on the pill, the system, or `stop()`. Returns the unsubscribe.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `cb` | (`result`) => `void` |

#### Returns

() => `void`

***

### stop

```ts
stop: () => Promise<CoworkCaptureResult>;
```

#### Returns

`Promise`\<[`CoworkCaptureResult`](/docs/reference/sdk/interfaces/coworkcaptureresult.md)\>
