listen / ali-vms
ali vms package
2.1.1
2019-01-31 01:43 UTC
Requires
- php: >=5.5.9
- listen/logcollector: ^4.1
README
Ali Vms Package For Laravel5
Usage
Composer Install
composer require listen/ali-vms
Publish And Update Config File
php artisan vendor:publish
Then Edit config/ali-vms.php
<?php return [ 'uri' => env('ALI_VMS_URI', 'http://nls-gateway.cn-shanghai.aliyuncs.com/stream/v1/asr'), // Request Uri 'appkey' => env('ALI_VMS_APPKEY', ''), // APP KEY 'host' => env('ALI_VMS_HOST', 'nls-gateway.cn-shanghai.aliyuncs.com'), // Host 'timeout' => 120, 'log_file' => storage_path('logs/alivms.log'), // Log File Path 'log_channel' => env('ALIVMS_LOG_CHANNEL', 'alivms'), 'log_mode' => env('ALIVMS_LOG_MODE', 'single') ];
Update config/app.php
providers => [
......
Listen\AliVms\AliVmsServiceProvider::class,
],
......
aliases => [
......
'AliVms' => Listen\AliVms\Facades\AliVms::class,
]
Send Request
# use tmp file $file = $request->file('audio'); dd(AliVms::voiceDetection($file->getRealPath())); # use file dd(AliVms::voiceDetection('path/to/file.pcm'));
push Exception callback
\AliVms::pushExceptionCallback('dingtalk', function ($module, $message, $code, $otherParams) {
// https://github.com/listen-rain/dingtalk
sendByDingtalk($message . "\n\n Code: {$code}", "{$module}.error");
});
Contact Me
Email : zhufengwei@aliyun.com
Wechat: w15275049388