coze-dev / coze-dev/coze-js

uniapp 版本微信小程序流式语音问题,是否支持生成音频文件,手动暂停播放

Open
#303 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
292
Forks
99
PR merge metrics
No merged PRs in 30d

Description

您好,目前这边的需求是在uniapp 微信小程序中接入coze,实现语音与文字(流式)同时存在,可手动暂停、播放,后续在列表也可以进行暂停与播放操作
一、使用uniapp版本WsChatClient的过程中遇到以下几个问题:
1.是否支持音频文件生成
根据文档这样设置无效
` debug: true,
wavRecordConfig: {
enableSourceRecord: true, // 启用原始音频录制
enableDenoiseRecord: false, // 启用降噪后的音频录制
}

// 监听音频输入 dump 事件
speechClient.on(WsChatEventNames.AUDIO_INPUT_DUMP, (eventName, event) => {
// event.data 包含:
// - name: string 文件名
console.log(event.data,'===event.data')
const { name, wav } = event.data;
console.log(`收到音频dump,文件名: ${name}`);
});

`
2.是否支持可以获取follow_up类型数据(follow_up:如果智能体打开了用户问题建议开关,则返回配置的推荐问题)
目前使用WsChatClient获取不到相关数据,通过对话接口可以获取
`speechClient.on(
WsChatEventNames.CONVERSATION_MESSAGE_COMPLETED,
(_, data) => {
const event = data;
console.log(event,'======完成参数')
if (event.type === 'follow_up') {
}
},
);`
二、使用uniapp版本WsSpeechClient的过程中前面的问题也存在,可以进行暂停、播放操作,但当返回数据多时报4008用户限流

Contributor guide

Open the contributing guide

Research direction

Start with the uniapp WsChatClient and WsSpeechClient flows described in the issue, including AUDIO_INPUT_DUMP and CONVERSATION_MESSAGE_COMPLETED handling. Reproduce the missing audio-file and follow_up events, pause/play behavior, and 4008 response with larger returned data; done requires documented or implemented behavior for each reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, audio-video-rtc
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.