1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- require dirname(__FILE__, 2) . '/vendor/autoload.php';
- $secretId = "SECRETID";
- $secretKey = "SECRETKEY";
- $region = "ap-beijing";
- $cosClient = new Qcloud\Cos\Client(
- array(
- 'region' => $region,
- 'scheme' => 'https',
- 'credentials'=> array(
- 'secretId' => $secretId,
- 'secretKey' => $secretKey)));
- try {
-
-
- $result = $cosClient->createVoiceSpeechRecognitionJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'SpeechRecognition',
- 'Input' => array(
- 'Object' => 'test.mp3',
- ),
- 'Operation' => array(
- 'TemplateId' => '',
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'xxx.txt',
- ),
- ),
- ));
-
- print_r($result);
-
- $result = $cosClient->createVoiceSpeechRecognitionJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'SpeechRecognition',
- 'Input' => array(
- 'Object' => 'test.mp3',
- ),
- 'Operation' => array(
- 'SpeechRecognition' => array(
- 'EngineModelType' => '16k_zh',
- 'ChannelNum' => 1,
- 'ResTextFormat' => 1,
- 'FilterDirty' => 0,
- 'FilterModal' => 1,
- 'ConvertNumMode' => 0,
- 'SpeakerDiarization' => 1,
- 'SpeakerNumber' => 0,
- 'FilterPunc' => 0,
- ),
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'xxx.txt',
- ),
- ),
- ));
-
- print_r($result);
- } catch (\Exception $e) {
-
- echo($e);
- }
|