-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add asr interface
- Loading branch information
Showing
16 changed files
with
1,043 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
require dirname(__FILE__, 2) . '/vendor/autoload.php'; | ||
|
||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket | ||
$cosClient = new Qcloud\Cos\Client( | ||
array( | ||
'region' => $region, | ||
'scheme' => 'https', // 万象接口必须用https | ||
'credentials' => array( | ||
'secretId' => $secretId, | ||
'secretKey' => $secretKey))); | ||
try { | ||
// 关闭智能语音服务 https://cloud.tencent.com/document/product/460/95755 | ||
$result = $cosClient->closeAsrService(array( | ||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket | ||
)); | ||
print_r($result); | ||
} catch (\Exception $e) { | ||
// 请求失败 | ||
echo($e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
require dirname(__FILE__, 2) . '/vendor/autoload.php'; | ||
|
||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket | ||
$cosClient = new Qcloud\Cos\Client( | ||
array( | ||
'region' => $region, | ||
'scheme' => 'https', //协议头部,默认为http | ||
'credentials'=> array( | ||
'secretId' => $secretId, | ||
'secretKey' => $secretKey))); | ||
try { | ||
// 创建音频降噪模板 https://cloud.tencent.com/document/product/460/94315 | ||
$result = $cosClient->createMediaNoiseReductionTemplate(array( | ||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket | ||
'Tag' => 'NoiseReduction', | ||
'Name' => 'NoiseReduction-Template', | ||
'NoiseReduction' => array( | ||
'Format' => 'wav', | ||
'Samplerate' => '16000', | ||
), | ||
)); | ||
// 请求成功 | ||
print_r($result); | ||
} catch (\Exception $e) { | ||
// 请求失败 | ||
echo($e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
require dirname(__FILE__, 2) . '/vendor/autoload.php'; | ||
|
||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket | ||
$cosClient = new Qcloud\Cos\Client( | ||
array( | ||
'region' => $region, | ||
'scheme' => 'https', //协议头部,默认为http | ||
'credentials'=> array( | ||
'secretId' => $secretId, | ||
'secretKey' => $secretKey))); | ||
try { | ||
// 提交听歌识曲任务 https://cloud.tencent.com/document/product/460/84795 | ||
$result = $cosClient->createVoiceSoundHoundJobs(array( | ||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket | ||
'Tag' => 'SoundHound', | ||
'Input' => array( | ||
'Object' => 'test.mp3', | ||
), | ||
'Operation' => array( | ||
'UserData' => 'xxx', // 透传用户信息 | ||
'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 | ||
), | ||
// 'CallBack' => '', | ||
// 'CallBackFormat' => '', | ||
// 'CallBackType' => '', | ||
// 'CallBackMqConfig' => array( | ||
// 'MqRegion' => '', | ||
// 'MqMode' => '', | ||
// 'MqName' => '', | ||
// ), | ||
)); | ||
// 请求成功 | ||
print_r($result); | ||
} catch (\Exception $e) { | ||
// 请求失败 | ||
echo($e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
require dirname(__FILE__, 2) . '/vendor/autoload.php'; | ||
|
||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket | ||
$cosClient = new Qcloud\Cos\Client( | ||
array( | ||
'region' => $region, | ||
'scheme' => 'https', //协议头部,默认为http | ||
'credentials'=> array( | ||
'secretId' => $secretId, | ||
'secretKey' => $secretKey))); | ||
try { | ||
// 提交音乐评分任务 https://cloud.tencent.com/document/product/460/96095 | ||
$result = $cosClient->createVoiceVocalScoreJobs(array( | ||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket | ||
'Tag' => 'VocalScore', | ||
'Input' => array( | ||
'Object' => 'test.mp3', | ||
), | ||
'Operation' => array( | ||
"VocalScore" => array( | ||
'StandardObject' => 'test.mp3', | ||
), | ||
// 'UserData' => 'xxx', // 透传用户信息 | ||
// 'JobLevel' => '0', // 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0 | ||
), | ||
// 'CallBack' => '', | ||
// 'CallBackFormat' => '', | ||
// 'CallBackType' => '', | ||
// 'CallBackMqConfig' => array( | ||
// 'MqRegion' => '', | ||
// 'MqMode' => '', | ||
// 'MqName' => '', | ||
// ), | ||
)); | ||
// 请求成功 | ||
print_r($result); | ||
} catch (\Exception $e) { | ||
// 请求失败 | ||
echo($e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
require dirname(__FILE__, 2) . '/vendor/autoload.php'; | ||
|
||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket | ||
$cosClient = new Qcloud\Cos\Client( | ||
array( | ||
'region' => $region, | ||
'scheme' => 'https', // 万象接口必须用https | ||
'credentials'=> array( | ||
'secretId' => $secretId, | ||
'secretKey' => $secretKey))); | ||
|
||
try { | ||
// 查询智能语音服务 https://cloud.tencent.com/document/product/460/46232 | ||
$result = $cosClient->getAsrBucketList(array( | ||
// 'Regions' => '', // 可选 地域信息,例如 ap-shanghai、ap-beijing,若查询多个地域以“,”分隔字符串 | ||
// 'BucketNames' => '', // 可选 存储桶名称,以“,”分隔,支持多个存储桶,精确搜索 | ||
// 'BucketName' => '', // 可选 存储桶名称前缀,前缀搜索 | ||
// 'PageNumber' => 1, // 可选 第几页 | ||
// 'PageSize' => 20, // 可选 每页个数 | ||
)); | ||
// 请求成功 | ||
print_r($result); | ||
} catch (\Exception $e) { | ||
// 请求失败 | ||
echo($e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
require dirname(__FILE__, 2) . '/vendor/autoload.php'; | ||
|
||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket | ||
$cosClient = new Qcloud\Cos\Client( | ||
array( | ||
'region' => $region, | ||
'scheme' => 'https', // 万象接口必须为https | ||
'credentials' => array( | ||
'secretId' => $secretId, | ||
'secretKey' => $secretKey))); | ||
try { | ||
// 查询智能语音队列 https://cloud.tencent.com/document/product/460/46234 | ||
$result = $cosClient->getAsrQueueList(array( | ||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket | ||
// 'QueueIds' => 'xxx', // 队列 ID,以“,”符号分割字符串 | ||
// 'State' => 'Active', // Active 表示队列内的作业会被媒体处理服务调度执行, Paused 表示队列暂停,作业不再会被媒体处理调度执行,队列内的所有作业状态维持在暂停状态,已经执行中的任务不受影响 | ||
// 'PageNumber' => '1', // 第几页 | ||
// 'PageSize' => '10', // 每页个数 | ||
)); | ||
print_r($result); | ||
} catch (\Exception $e) { | ||
// 请求失败 | ||
echo($e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
require dirname(__FILE__, 2) . '/vendor/autoload.php'; | ||
|
||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket | ||
$cosClient = new Qcloud\Cos\Client( | ||
array( | ||
'region' => $region, | ||
'scheme' => 'https', // 万象接口必须用https | ||
'credentials' => array( | ||
'secretId' => $secretId, | ||
'secretKey' => $secretKey))); | ||
try { | ||
// 开通智能语音服务 https://cloud.tencent.com/document/product/460/95754 | ||
$result = $cosClient->openAsrService(array( | ||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket | ||
)); | ||
print_r($result); | ||
} catch (\Exception $e) { | ||
// 请求失败 | ||
echo($e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
require dirname(__FILE__, 2) . '/vendor/autoload.php'; | ||
|
||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket | ||
$cosClient = new Qcloud\Cos\Client( | ||
array( | ||
'region' => $region, | ||
'scheme' => 'https', // 万象接口必须为https | ||
'credentials'=> array( | ||
'secretId' => $secretId, | ||
'secretKey' => $secretKey))); | ||
try { | ||
// 更新智能语音队列 https://cloud.tencent.com/document/product/460/46235 | ||
$result = $cosClient->updateAsrQueue(array( | ||
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket | ||
'Key' => '', // queueId | ||
'Name' => 'queue-smart-audio', | ||
'State' => 'Active', | ||
'NotifyConfig' => array( | ||
'State' => 'Off', | ||
// 'Event' => '', | ||
// 'ResultFormat' => '', | ||
// 'Type' => '', | ||
// 'Url' => '', | ||
// 'MqMode' => '', | ||
// 'MqRegion' => '', | ||
// 'MqName' => '', | ||
), | ||
)); | ||
// 请求成功 | ||
print_r($result); | ||
} catch (\Exception $e) { | ||
// 请求失败 | ||
echo($e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
require dirname(__FILE__, 2) . '/vendor/autoload.php'; | ||
|
||
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi | ||
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket | ||
$cosClient = new Qcloud\Cos\Client( | ||
array( | ||
'region' => $region, | ||
'scheme' => 'https', //协议头部,默认为http | ||
'credentials'=> array( | ||
'secretId' => $secretId, | ||
'secretKey' => $secretKey))); | ||
try { | ||
// 更新音频降噪模板 https://cloud.tencent.com/document/product/460/94394 | ||
$result = $cosClient->updateMediaNoiseReductionTemplate(array( | ||
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket | ||
'Key' => '', // TemplateId | ||
'Tag' => 'NoiseReduction', | ||
'Name' => 'NoiseReduction-Template', | ||
'NoiseReduction' => array( | ||
'Format' => 'wav', | ||
'Samplerate' => '16000', | ||
), | ||
)); | ||
// 请求成功 | ||
print_r($result); | ||
} catch (\Exception $e) { | ||
// 请求失败 | ||
echo($e); | ||
} |
Oops, something went wrong.