You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.2 KiB
2.2 KiB
LINGYUN.Abp.Tencent.TTS
Tencent Cloud Text-to-Speech (TTS) Service Module, integrating Tencent Cloud TTS service into ABP applications.
Features
- Support for Tencent Cloud Text-to-Speech (TTS) service
- Multi-tenant configuration support
- Based on Tencent Cloud TTS SDK V20190823
- Provides TTS client factory for dynamic TTS client creation
Basic Usage
- Add module dependency
[DependsOn(typeof(AbpTencentTTSModule))]
public class YourModule : AbpModule
{
// ...
}
- Configure Tencent Cloud service
{
"Settings": {
"LINGYUN.Abp.Tencent": {
"SecretId": "Your Tencent Cloud SecretId",
"SecretKey": "Your Tencent Cloud SecretKey"
}
}
}
- TTS service usage example
public class YourService
{
private readonly TencentCloudTTSClientFactory _ttsClientFactory;
public YourService(TencentCloudTTSClientFactory ttsClientFactory)
{
_ttsClientFactory = ttsClientFactory;
}
public async Task TextToSpeechAsync(string text)
{
var ttsClient = await _ttsClientFactory.CreateAsync();
// Use ttsClient to call Tencent Cloud TTS service APIs
// For detailed API usage, please refer to Tencent Cloud TTS SDK documentation
}
}
Configuration Items
Basic Configuration
{
"Settings": {
"Abp.TencentCloud": {
"SecretId": "Your Tencent Cloud SecretId", // Get from Tencent Cloud Console
"SecretKey": "Your Tencent Cloud SecretKey", // Get from Tencent Cloud Console
"DurationSecond": "600" // Session duration in seconds
}
}
}
TTS Service Configuration
{
"Settings": {
"Abp.TencentCloud.TTS": {
"AppId": "", // TTS application ID
"VoiceType": "", // Voice type, default is "0"
"Language": "1", // Language, 1-Chinese, 2-English
"Speed": "0", // Speech speed, range: -2~2
"Volume": "0", // Volume, range: 0~10
"ProjectId": "0" // Project ID
}
}
}