---
title: hi_mpi_ai_set_pub_attr
description: "| 产品 | 是否支持 |"
url: "https://www.hiascend.com/document/detail/zh/canncommercial/900/API/dvpp/aclcppdevg_03_0412.html"
---

# hi_mpi_ai_set_pub_attr

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | ☓ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | ☓ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | ☓ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | ☓ |
| Atlas 训练系列产品 | ☓ |


#### 功能说明

设置AI设备属性。


#### 函数原型

```
hi_s32
hi_mpi_ai_set_pub_attr(
hi_audio_dev
ai_dev,
hi_aio_attr
*attr)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明。 |
| --- | --- | --- |
| ai\_dev | 输入 | 音频设备号，取值范围：[0, 2]。 |
| attr | 输入 | AI设备属性。 |


#### 返回值说明

- 0：成功
- 非0：失败，参见  音频相关返回码
。


#### 约束说明

- 仅支持I2S主模式。
- 在双声道和右声道模式下，chn_cnt需为2；在左声道模式下，chn_cnt需为1。


#### 参考资源

接口调用流程，参见音频获取&音频播放(https://www.hiascend.com/document/detail/zh/canncommercial/900/programug/acldevg/aclcppdevg_000069.html)。
