PHPackages                             jingfengshi/baidu-voice - 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. jingfengshi/baidu-voice

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

jingfengshi/baidu-voice
=======================

A voice SDK

0.0.1(7y ago)16MITPHP

Since Jan 4Pushed 7y agoCompare

[ Source](https://github.com/jingfengshi/baidu-voice)[ Packagist](https://packagist.org/packages/jingfengshi/baidu-voice)[ RSS](/packages/jingfengshi-baidu-voice/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (5)Used By (0)

 baidu-voice
=============

[](#-baidu-voice-)

🌈 基于百度语音接口 PHP 获取语音内容的信息组件

[![Build Status](https://camo.githubusercontent.com/bd83dcbbe28e3cf027d5401e1ad7751501853945db441c95427f656c244b9478/68747470733a2f2f7472617669732d63692e6f72672f6a696e6766656e677368692f62616964752d766f6963652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jingfengshi/baidu-voice)[![StyleCI build status](https://camo.githubusercontent.com/34758a8ee6497376be4c7e0cb50f98d0b14092a9d59880f38ca6962acf8e6d00/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136343036323636372f736869656c64)](https://camo.githubusercontent.com/34758a8ee6497376be4c7e0cb50f98d0b14092a9d59880f38ca6962acf8e6d00/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136343036323636372f736869656c64)

安装
--

[](#安装)

```
$ composer require jingfengshi/baidu-voice -vvv
```

使用
--

[](#使用)

```
    use jingfengshi\BaiduVoice\AiSpeech;
    $appId='xxx';
    $appKey='xxx';
    $appSecret='xxx';
    $ai_speech=new AiSpeech($appId,$appKey,$appSecret);
    $res=$ai_speech->getContentFromVoice(file_get_contents(public_path().'/test.pcm'),'pcm',8000);
    dd($res)
```

在Laravel中使用
-----------

[](#在laravel中使用)

在laravel中使用也是同样的安装方式，配置写在 `config/service.php`中

```
    .
    .
    .
     'weather' => [
        'appId' => env('BAIDU_VOICE_API_ID'),
        'appKey' => env('BAIDU_VOICE_API_KEY'),
        'appSecret' => env('BAIDU_VOICE_API_SECRET'),
    ],
```

然后在 `.env`中配置`BAIDU_VOICE_API_ID`

```
BAIDU_VOICE_API_ID=xxxx
```

可以使用两种方式来获取 `jingfengshi\BaiduVoice\AiSpeech` 实例:

方法参数注入
------

[](#方法参数注入)

```
  .
    .
    .
    public function edit(AiSpeech $aiSpeech)
    {
        $response = $weather->getContentFromVoice(file_get_contents(public_path().'/test.pcm'),'pcm',8000);
    }
    .
    .
    .
```

服务名访问
-----

[](#服务名访问)

```
 .
    .
    .
    public function edit()
    {
        $response = app('AiSpeech')->getContentFromVoice(file_get_contents(public_path().'/test.pcm'),'pcm',8000);;
    }
    .
    .
    .
```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/jingfengshi/baidu-voice/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/jingfengshi/baidu-voice/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

2685d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62912b929bd98eae8d5a55a65fe9d1f4103bcf8af4e0163d5858af1446b0296e?d=identicon)[jingfengshi](/maintainers/jingfengshi)

---

Top Contributors

[![jingfengshi](https://avatars.githubusercontent.com/u/19483102?v=4)](https://github.com/jingfengshi "jingfengshi (21 commits)")

### Embed Badge

![Health badge](/badges/jingfengshi-baidu-voice/health.svg)

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

###  Alternatives

[instride/data-definitions

Data Definitions allows you to define your DataObject Imports and Exports using a nice GUI and re-run the definitions as often you like.

8117.7k](/packages/instride-data-definitions)

PHPackages © 2026

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