# Play a voice sample

`GET` `https://goblins-call-api.onrender.com/v1/providers/voices/:id/preview`

Streams a voice’s sample clip as audio.

Needs a [workspace API key](https://www.cracklehq.com/docs/authentication).

## Path parameters

- `id` (string, required): A voice ID from List voices.

## Errors

- `404`: The voice does not exist or has no sample.

Every request can also answer `401`, `429` and `500`: see [Errors](https://www.cracklehq.com/docs/errors).

Request:

cURL:

```bash
curl "https://goblins-call-api.onrender.com/v1/providers/voices/VOICE_ID/preview" \
  -H "Authorization: Bearer $CRACKLE_API_KEY" \
  --output sample.wav
```

Node.js:

```js
const response = await fetch('https://goblins-call-api.onrender.com/v1/providers/voices/VOICE_ID/preview', {
  headers: {
    Authorization: `Bearer ${process.env.CRACKLE_API_KEY}`,
  },
});
if (!response.ok) throw new Error(await response.text());
const audio = Buffer.from(await response.arrayBuffer());
```

Python:

```python
import os
import requests

response = requests.get(
    "https://goblins-call-api.onrender.com/v1/providers/voices/VOICE_ID/preview",
    headers={"Authorization": f"Bearer {os.environ['CRACKLE_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
audio = response.content
```

Response · 200 OK:

```
(audio bytes, with a Content-Type such as audio/wav)
```

Source: https://www.cracklehq.com/docs/reference/voices/preview
