# C API: Clips

`sona_clip_info` holds `key` ("GenericWave", "Stand0", ...), `id` (the clip's item id, or NULL for "idle", "still" and "prop"), `seconds` (negative when not known until decoded), `prop` (1 for the held prop's own clip) and `caption` (may be NULL).

## sona_clip_count

```c
uint32_t sona_clip_count(const sona_ctx *ctx);
```

| Parameter | Type | Meaning | Default |
|---|---|---|---|
| `ctx` | `const sona_ctx *` | The context | required |

**Returns** `uint32_t`.

**Example**:

```c
uint32_t x_got = sona_clip_count(ctx);
printf("sona_clip_count: %lld\n", (long long)x_got);
```

How many clips the context knows.

## sona_clip_get

```c
sona_result sona_clip_get(const sona_ctx *ctx, uint32_t index, sona_clip_info *out);
```

| Parameter | Type | Meaning | Default |
|---|---|---|---|
| `ctx` | `const sona_ctx *` | The context | required |
| `index` | `uint32_t` | Which one, from 0 | - |
| `out` | `sona_clip_info *` | Receives the [`sona_clip_info`](../fields.md#sona_clip_info) | required |

**Returns** `SONA_OK`. **Errors** `SONA_E_ARGUMENT` ([what each means](../../troubleshooting.md#error-codes)).

**Example**:

```c
sona_clip_info x_clip_info;
memset(&x_clip_info, 0, sizeof x_clip_info);
sona_result result = sona_clip_get(ctx, 0, &x_clip_info);
if (result != SONA_OK) printf("sona_clip_get: %s\n", sona_result_name(result));
```

One clip by index, `0 .. sona_clip_count() - 1`.
