---
name: "getVoiceList"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.36" }
  - { name: "Base library", version: "2.21.0" }
title: "Robot Voice"
---

## getVoiceList

> [VERSION] @ray-js/ray >= 1.5.36 | Base library >= 2.21.0

### Description

Get the robot vacuum's voice package list

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetVoiceListParams` | Yes | Query parameters including Device ID and pagination info |

### Return Value

Type: `Promise<GetVoiceListResponse>`

Promise that resolves with the voice package list, current page number, and total count

##### GetVoiceListResponse

| Property | Type | Description |
| --- | --- | --- |
| `datas` | `VoiceItem[]` | Array of voice package data |
| `pageNo` | `number` | Current page number |
| `totalCount` | `number` | Total count |

### Referenced Types

##### `interface` GetVoiceListParams

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `deviceId` | `string` | Device ID (compatibility field) |
| `offset` | `number` | Pagination offset; can be 0 if there are few voice packages |
| `limit` | `number` | Page size, recommended 100 |

##### `interface` VoiceItem

| Property | Type | Description |
| --- | --- | --- |
| `auditionUrl` | `string` | Preview link |
| `desc` | `string` | Description (optional) |
| `extendData` | `VoiceExtendData` | Extension data |
| `id` | `number` | Voice pack ID |
| `imgUrl` | `string` | Cover image link |
| `name` | `string` | Voice pack name |
| `officialUrl` | `string` | Official download link |
| `productId` | `string` | Product ID |
| `region` | `string[]` | Array of available region codes |

##### `interface` VoiceExtendData

| Property | Type | Description |
| --- | --- | --- |
| `extendId` | `number` | Extension ID; compare with the language pack ID reported by the device to determine whether it is in use |
| `version` | `string` | Version |


### Examples

```tsx
import React from 'react';
import { Button, getVoiceList } from '@ray-js/ray';

export default function Demo() {
  const handleFetch = async () => {
    const result = await getVoiceList({
      devId: 'your-device-id',
      offset: 0,
      limit: 100,
    });
    console.log(result.datas, result.totalCount);
  };
  return <Button onClick={handleFetch}>Get voice package list</Button>;
}
```
