Skip to content

Commit 645bb66

Browse files
committed
feat: support voice emotions
1 parent 3068887 commit 645bb66

File tree

6 files changed

+50
-2
lines changed

6 files changed

+50
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze/api",
5+
"comment": "support voice emotions",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@coze/api",
10+
"email": "[email protected]"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze/api",
5+
"comment": "support voice emotions",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@coze/api",
10+
"email": "[email protected]"
11+
}

packages/coze-js/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coze/api",
3-
"version": "1.3.5",
3+
"version": "1.3.6",
44
"description": "Official Coze Node.js SDK for seamless AI integration into your applications | 扣子官方 Node.js SDK,助您轻松集成 AI 能力到应用中",
55
"keywords": [
66
"coze",
@@ -35,6 +35,7 @@
3535
"node-fetch": false,
3636
"ws": false
3737
},
38+
"types": "dist/types/index.d.ts",
3839
"typesVersions": {
3940
"*": {
4041
".": [
@@ -116,4 +117,4 @@
116117
"agora-rtc-sdk-ng": "$agora-rtc-sdk-ng"
117118
}
118119
}
119-
}
120+
}

packages/coze-js/src/resources/audio/speech/speech.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@ export interface CreateSpeechReq {
4343
/** Sample rate, default is 24000, supports 8000, 16000, 24000, 32000, 44100, 48000
4444
* | 采样率,默认是24000,支持8000, 16000, 24000, 32000, 44100, 48000 */
4545
sample_rate?: number;
46+
/** 情感,默认为空 */
47+
emotion?: string;
48+
/** 情感强度,[1,5],默认为4,通常保留一位小数即可 */
49+
emotion_scale?: number;
4650
}

packages/coze-js/src/resources/audio/voices/voices.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ export interface ListVoicesData {
103103
has_more: boolean;
104104
}
105105

106+
export interface Interval {
107+
min?: number;
108+
max?: number;
109+
default?: number;
110+
}
111+
112+
export interface EmotionInfo {
113+
emotion?: string;
114+
display_name?: string;
115+
emotion_scale_interval?: Interval;
116+
}
117+
106118
export interface Voice {
107119
/** Whether it is a system voice | 是否为系统音色 */
108120
is_system_voice: boolean;
@@ -125,4 +137,6 @@ export interface Voice {
125137
available_training_times: number;
126138
/** Preview audio | 预览音频 */
127139
preview_audio: string;
140+
/** 支持的情感列表 */
141+
support_emotions?: EmotionInfo[];
128142
}

packages/coze-js/src/resources/websockets/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,13 @@ interface OutputAudio {
518518
/**输出音频的语速,取值范围 [-50, 100],默认为 0。-50 表示 0.5 倍速,100 表示 2 倍速。 */
519519
speech_rate?: number;
520520
voice_id?: string;
521+
/** 输出语音的情感配置 */
522+
emotion_config?: {
523+
/** 情感 */
524+
emotion?: string;
525+
/** 情绪值 */
526+
emotion_scale?: number;
527+
};
521528
}
522529

523530
export interface TurnDetection {

0 commit comments

Comments
 (0)