PHP code example of pinkong / baidu-speech-recognition

1. Go to this page and download the library: Download pinkong/baidu-speech-recognition library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pinkong / baidu-speech-recognition example snippets


[
    'providers' => [
        Pinkong\BaiduSpeechRecognition\BaiduSpeechServiceProvider::class,
    ],
]

    'aliases' => [
        'SpeechHelper' => Pinkong\BaiduSpeechRecognition\SpeechHelper::class,
    ],


$app->register(Pinkong\BaiduSpeechRecognition\BaiduSpeechServiceProvider::class);

php artisan vendor:publish --provider="Pinkong\BaiduSpeechRecognition\BaiduSpeechServiceProvider"


$app->configure('baiduspeech');

$result = SpeechHelper::convertMp3FileToPCM('test4.mp3');