PHPackages                             jormin/laravel-baidu-speech - 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. jormin/laravel-baidu-speech

ActiveLibrary

jormin/laravel-baidu-speech
===========================

百度语音Api集成

v1.0.3(7y ago)3420MITPHPPHP ~5.6|~7.0

Since Oct 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jormin/laravel-baidu-speech)[ Packagist](https://packagist.org/packages/jormin/laravel-baidu-speech)[ Docs](https://github.com/jormin/laravel-baidu-speech)[ RSS](/packages/jormin-laravel-baidu-speech/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

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

安装
--

[](#安装)

1. 安装包文件

    ```
    $ composer require jormin/laravel-baidu-speech
    ```

配置
--

[](#配置)

1. 注册 ServiceProvider:

    ```
    Jormin\BaiduSpeech\BaiduSpeechServiceProvider::class,
    ```
2. 创建配置文件：

    ```
    php artisan vendor:publish
    ```

    执行命令后会在 `config` 目录下生成本扩展配置文件：`laravel-baidu-speech.php`。
3. 在 `.env` 文件中增加如下配置：

    - `BAIDU_APP_ID`：百度AppId。
    - `BAIDU_API_KEY`：百度ApiKey。
    - `BAIDU_SECRET_KEY`：百度SecretKey。

使用
--

[](#使用)

1. 语音识别

    ```
       Jormin\BaiduSpeech\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接口返回字段详细见 [百度官方文档](https://cloud.baidu.com/doc/SPEECH/ASR-Online-PHP-SDK.html).
2. 语音合成

    ```
       Jormin\BaiduSpeech\BaiduSpeech::combine($text, $userID, $lan, $speed, $pitch, $volume, $person, $filename);
    ```

    接口字段：

    参数类型说明可为空textString合成的文本NuserIDString用户唯一标识YlanString语言，可选值 \['zh'\]，默认为zhYspeedInteger语速，取值0-9，默认为5中语速YpitchInteger音调，取值0-9，默认为5中语调YvolumeInteger音量，取值0-15，默认为5中音量YpersonInteger发音人选择, 0为女声，1为男声，3为情感合成-度逍遥，4为情感合成-度丫丫，默认为普通女YfileNameString文件存储路径名称，默认存储在`public/audios/`目录下Y接口返回字段详细见 [百度官方文档](https://cloud.baidu.com/doc/SPEECH/TTS-Online-PHP-SDK.html).

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% 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.

###  Release Activity

Cadence

Every ~168 days

Total

4

Last Release

2624d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6ee6d33268c4673c2c01a955a3194083ed174f719ea76bbc259f16dd8615115?d=identicon)[jormin](/maintainers/jormin)

---

Top Contributors

[![jormin](https://avatars.githubusercontent.com/u/5519318?v=4)](https://github.com/jormin "jormin (11 commits)")[![imzhi](https://avatars.githubusercontent.com/u/2304019?v=4)](https://github.com/imzhi "imzhi (1 commits)")

---

Tags

Jormin

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jormin-laravel-baidu-speech/health.svg)

```
[![Health](https://phpackages.com/badges/jormin-laravel-baidu-speech/health.svg)](https://phpackages.com/packages/jormin-laravel-baidu-speech)
```

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[jormin/laravel-geetest

极验验证码 v3.0 Laravel 扩展包

309.7k](/packages/jormin-laravel-geetest)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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