@coze/realtime-api 1.0.4 → 1.0.5-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -56,6 +56,15 @@ const client = new RealtimeClient({
56
56
  voiceId: "your_voice_id", // Optional: Specify voice ID
57
57
  conversationId: "conversation_id", // Optional: For conversation continuity
58
58
  debug: true, // Optional: Enable debug logging
59
+ getRoomInfo: async () => {
60
+ // Customize get room info
61
+ return {
62
+ token: "your_token",
63
+ uid: "your_uid",
64
+ room_id: "your_room_id",
65
+ app_id: "your_app_id",
66
+ };
67
+ },
59
68
  allowPersonalAccessTokenInBrowser: true, // Optional: Enable PAT token usage in browser
60
69
  audioMutedDefault: false, // Optional: Initial audio state (default: false)
61
70
  suppressStationaryNoise: false, // Optional: Enable stationary noise suppression(default: false)
@@ -83,7 +92,9 @@ const operations = {
83
92
  disconnect: () => client.disconnect(),
84
93
  interrupt: () => client.interrupt(),
85
94
  toggleMicrophone: (enabled: boolean) => client.setAudioEnable(enabled),
86
- checkConnection: () => client.isConnected
95
+ checkConnection: () => client.isConnected,
96
+ // get rtc engine instance, for detail visit https://www.volcengine.com/docs/6348/104478#rtcengine
97
+ getRtcEngine: () => client.getRtcEngine(),
87
98
  };
88
99
 
89
100
  // Event Handling
package/README.zh-CN.md CHANGED
@@ -56,6 +56,15 @@ const client = new RealtimeClient({
56
56
  voiceId: "your_voice_id", // 可选:指定音色 ID
57
57
  conversationId: "conversation_id", // 可选:用于对话连续性
58
58
  debug: true, // 可选:启用调试日志
59
+ getRoomInfo: async () => {
60
+ // 自定义获取房间信息
61
+ return {
62
+ token: "your_token",
63
+ uid: "your_uid",
64
+ room_id: "your_room_id",
65
+ app_id: "your_app_id",
66
+ };
67
+ },
59
68
  allowPersonalAccessTokenInBrowser: true, // 可选:在浏览器中启用 PAT 令牌使用
60
69
  audioMutedDefault: false, // 可选:初始音频状态(默认:false)
61
70
  suppressStationaryNoise: false, // 可选:启用静态噪声抑制(默认:false)
@@ -79,7 +88,9 @@ const operations = {
79
88
  disconnect: () => client.disconnect(),
80
89
  interrupt: () => client.interrupt(),
81
90
  toggleMicrophone: (enabled: boolean) => client.setAudioEnable(enabled),
82
- checkConnection: () => client.isConnected
91
+ checkConnection: () => client.isConnected,
92
+ // 获取 RTC 引擎实例,详情请访问 https://www.volcengine.com/docs/6348/104478#rtcengine
93
+ getRtcEngine: () => client.getRtcEngine(),
83
94
  };
84
95
 
85
96
  // 事件处理