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

### Referenced Types

##### `interface` GetVoiceListParams

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


### 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>;
}
```
