You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

C#使用Google.Cloud.TextToSpeech.V1如何指定effects_profile_id音频配置

问题解答

在Google.Cloud.TextToSpeech.V1的C# SDK中,Python的effects_profile_id参数对应AudioConfig类的EffectsProfileId属性,该属性是可重复的集合类型,支持传入多个音频效果配置ID。

你只需要在现有AudioConfig的初始化逻辑中添加该属性赋值即可,修改后的代码示例如下:

// Specify the type of audio file.
var audioConfig = new AudioConfig
{
    AudioEncoding = AudioEncoding.Linear16,
    // 替换为你实际需要使用的音频效果配置ID即可,可添加多个
    EffectsProfileId = { "wearable-class-device" }
};

如果需要传入多个效果配置,直接在花括号内用逗号分隔多个字符串ID即可,和Python传入列表的逻辑完全一致。

内容的提问来源于stack exchange,提问作者Shereen Bashar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.28 19:45:03