From 9b37bbc2b28fc9e98ddcb49c32e9ecab83dd6043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AA=97=E8=BE=B9=E7=9A=84=E5=B0=8F=E8=B1=86=E8=B1=86?= <4563196@qq.com> Date: Mon, 27 Mar 2023 08:27:24 +0000 Subject: [PATCH 1/4] update composer.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 窗边的小豆豆 <4563196@qq.com> --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 68b70f8..7a7c07c 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "dflydev/fig-cookies": "^2.0.0", "guzzlehttp/guzzle": "^6.3.3", "qcloud/cos-sdk-v5": "^2.0", - "tencentcloud/tencentcloud-sdk-php": "^3.0", + "tencentcloud/tencentcloud-sdk-php": "^3.0.853", "league/flysystem": "^1.0.55", "symfony/console": "^5.0", "league/oauth2-server": "~8.1.1", -- Gitee From ac5941627ebbdaa226f2c4598ecb0d3456e2c316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AA=97=E8=BE=B9=E7=9A=84=E5=B0=8F=E8=B1=86=E8=B1=86?= <4563196@qq.com> Date: Mon, 27 Mar 2023 08:29:14 +0000 Subject: [PATCH 2/4] add tts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 窗边的小豆豆 <4563196@qq.com> --- src/Qcloud/Services/TtsService.php | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/Qcloud/Services/TtsService.php diff --git a/src/Qcloud/Services/TtsService.php b/src/Qcloud/Services/TtsService.php new file mode 100644 index 0000000..d704022 --- /dev/null +++ b/src/Qcloud/Services/TtsService.php @@ -0,0 +1,47 @@ +fromJsonString(json_encode($params)); + return $this->client->TextToVoice($clientRequest)->serialize(); + } + + protected function getClient() + { + return new TtsClient($this->cred, self::REGION, $this->clientProfile); + } + + protected function setEndpoint() + { + return self::ENDPOINT; + } +} -- Gitee From ca14aaf8bafa67d4a4fdabe5bc6c3a8e878ec93f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AA=97=E8=BE=B9=E7=9A=84=E5=B0=8F=E8=B1=86=E8=B1=86?= <4563196@qq.com> Date: Mon, 27 Mar 2023 08:30:04 +0000 Subject: [PATCH 3/4] update src/Qcloud/QcloudManage.php. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 窗边的小豆豆 <4563196@qq.com> --- src/Qcloud/QcloudManage.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Qcloud/QcloudManage.php b/src/Qcloud/QcloudManage.php index 861fedb..79fdad8 100644 --- a/src/Qcloud/QcloudManage.php +++ b/src/Qcloud/QcloudManage.php @@ -31,6 +31,7 @@ use Discuz\Qcloud\Services\TmsService; use Discuz\Qcloud\Services\VodService; use Discuz\Qcloud\Services\YunsouService; use Discuz\Qcloud\Services\MsService; +use Discuz\Qcloud\Services\TtsService; use Illuminate\Contracts\Container\Container; use Illuminate\Support\Manager; use InvalidArgumentException; @@ -84,6 +85,11 @@ class QcloudManage extends Manager implements Factory return $this->buildService(ImsService::class, $this->qcloudConfig); } + public function createTtsDriver() + { + return $this->buildService(TtsService::class, $this->qcloudConfig); + } + public function createSmsDriver() { $config = $this->container->config('sms'); -- Gitee From f657ec3981c475ea538d38894f7dcc20a9592e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AA=97=E8=BE=B9=E7=9A=84=E5=B0=8F=E8=B1=86=E8=B1=86?= <4563196@qq.com> Date: Mon, 27 Mar 2023 08:30:51 +0000 Subject: [PATCH 4/4] update src/Qcloud/QcloudTrait.php. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 窗边的小豆豆 <4563196@qq.com> --- src/Qcloud/QcloudTrait.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Qcloud/QcloudTrait.php b/src/Qcloud/QcloudTrait.php index eca3345..aa09099 100644 --- a/src/Qcloud/QcloudTrait.php +++ b/src/Qcloud/QcloudTrait.php @@ -92,6 +92,11 @@ trait QcloudTrait return $this->getQcloud()->service('discuzcloud')->siteInfoDaily($params); } + public function TextToVoice($params = []) + { + return $this->getQcloud()->service('tts')->TextToVoice($params); + } + /* |-------------------------------------------------------------------------- | 云点播 -- Gitee