Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions common/changes/@coze/api/feat-voice-emotion_2025-08-12-08-11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@coze/api",
"comment": "support voice emotions",
"type": "minor"
}
],
"packageName": "@coze/api",
"email": "duwenhan@bytedance.com"
}
11 changes: 11 additions & 0 deletions common/changes/@coze/api/feat-voice-emotion_2025-08-12-08-14.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@coze/api",
"comment": "support voice emotions",
"type": "minor"
}
],
"packageName": "@coze/api",
"email": "duwenhan@bytedance.com"
}
11 changes: 11 additions & 0 deletions common/changes/@coze/api/feat-voice-emotion_2025-08-12-08-15.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@coze/api",
"comment": "support voice emotions",
"type": "minor"
}
],
"packageName": "@coze/api",
"email": "duwenhan@bytedance.com"
}
4 changes: 2 additions & 2 deletions packages/coze-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coze/api",
"version": "1.3.5",
"version": "1.3.6",
"description": "Official Coze Node.js SDK for seamless AI integration into your applications | 扣子官方 Node.js SDK,助您轻松集成 AI 能力到应用中",
"keywords": [
"coze",
Expand Down Expand Up @@ -116,4 +116,4 @@
"agora-rtc-sdk-ng": "$agora-rtc-sdk-ng"
}
}
}
}
4 changes: 4 additions & 0 deletions packages/coze-js/src/resources/audio/speech/speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ export interface CreateSpeechReq {
/** Sample rate, default is 24000, supports 8000, 16000, 24000, 32000, 44100, 48000
* | 采样率,默认是24000,支持8000, 16000, 24000, 32000, 44100, 48000 */
sample_rate?: number;
/** 情感,默认为空 */
emotion?: string;
/** 情感强度,[1,5],默认为4,通常保留一位小数即可 */
emotion_scale?: number;
}
14 changes: 14 additions & 0 deletions packages/coze-js/src/resources/audio/voices/voices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ export interface ListVoicesData {
has_more: boolean;
}

export interface Interval {
min?: number;
max?: number;
default?: number;
}

export interface EmotionInfo {
emotion?: string;
display_name?: string;
emotion_scale_interval?: Interval;
}

export interface Voice {
/** Whether it is a system voice | 是否为系统音色 */
is_system_voice: boolean;
Expand All @@ -125,4 +137,6 @@ export interface Voice {
available_training_times: number;
/** Preview audio | 预览音频 */
preview_audio: string;
/** 支持的情感列表 */
support_emotions?: EmotionInfo[];
}
7 changes: 7 additions & 0 deletions packages/coze-js/src/resources/websockets/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,13 @@ interface OutputAudio {
/**输出音频的语速,取值范围 [-50, 100],默认为 0。-50 表示 0.5 倍速,100 表示 2 倍速。 */
speech_rate?: number;
voice_id?: string;
/** 输出语音的情感配置 */
emotion_config?: {
/** 情感 */
emotion?: string;
/** 情绪值 */
emotion_scale?: number;
};
}

export interface TurnDetection {
Expand Down