PHPackages                             nufangtechnology/baidu\_ai - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nufangtechnology/baidu\_ai

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nufangtechnology/baidu\_ai
==========================

百度语音Api

170PHP

Since Jan 21Pushed 7y ago4 watchersCompare

[ Source](https://github.com/NufangTechnology/Baidu_AI)[ Packagist](https://packagist.org/packages/nufangtechnology/baidu_ai)[ RSS](/packages/nufangtechnology-baidu-ai/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (2)Used By (0)

集成了 [百度AI](http://ai.baidu.com/) 官方的Api接口。

安装
--

[](#安装)

1. 安装包文件

    ```
    $ composer require nufangtechnology/baidu_ai
    ```

说明
--

[](#说明)

1. 返回结果说明

    接口返回数据已经经过打包处理，为数组格式，包含三个字段:

    参数类型说明可为空successbool是否成功NmsgString结果说明Ndataarray百度语音接口返回数据，字段详细见 [百度官方文档](https://cloud.baidu.com/doc/SPEECH/TTS-Online-PHP-SDK.html).Y

使用
--

[](#使用)

1. 语音识别

    ```
       $baiduSpeech = new NufangTechnology\Baidu_AI\BaiduSpeech($appID, $apiKey, $secretKey);
       $baiduSpeech->recognize($filePath, $url, $callback, $userID, $format, $rate, $lan);
    ```

    接口字段：

    参数类型说明可为空filePathString语音文件本地路径，该字段和url字段二选一，优先使用此项YurlString语音文件URL路径，该字段和filePath字段二选一YcallbackString回调地址YuserIDString用户唯一标识YformatString语音文件格式，可选值 \['pcm', 'wav', 'opus', 'speex', 'amr'\]，默认为wavYrateInteger采样率，可选值 \[8000, 16000\]，默认为16000YlanString语言，可选值 \['zh', 'ct', 'en'\]，默认为zhY
2. 语音合成

    ```
       $baiduSpeech = new NufangTechnology\Baidu_AI\BaiduSpeech($appID, $apiKey, $secretKey);
       $baiduSpeech->combine($storagePath, $text, $userID, $lan, $speed, $pitch, $volume, $person);
    ```

    接口字段：

    参数类型说明可为空storagePathString文件存储路径，需是绝对路径NtextString合成的文本NuserIDString用户唯一标识YlanString语言，可选值 \['zh'\]，默认为zhYspeedInteger语速，取值0-9，默认为5中语速YpitchInteger音调，取值0-9，默认为5中语调YvolumeInteger音量，取值0-15，默认为5中音量YpersonInteger发音人选择, 0为女声，1为男声，3为情感合成-度逍遥，4为情感合成-度丫丫，默认为普通女Y

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e43f4b8db47f77d5f81070f920a6efa8878e7a226500d28488d4e93610d8d753?d=identicon)[Nufang T co](/maintainers/Nufang%20T%20co)

---

Top Contributors

[![anoxia](https://avatars.githubusercontent.com/u/5136384?v=4)](https://github.com/anoxia "anoxia (14 commits)")[![Cevenquan](https://avatars.githubusercontent.com/u/16284595?v=4)](https://github.com/Cevenquan "Cevenquan (11 commits)")

### Embed Badge

![Health badge](/badges/nufangtechnology-baidu-ai/health.svg)

```
[![Health](https://phpackages.com/badges/nufangtechnology-baidu-ai/health.svg)](https://phpackages.com/packages/nufangtechnology-baidu-ai)
```

###  Alternatives

[lstrojny/procrastinator

Do things as late as possible in a request. Don’t let your users wait

6332.6k1](/packages/lstrojny-procrastinator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
