Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

发送mp3文件异常 #16

Closed
su-chang opened this issue Dec 28, 2020 · 10 comments
Closed

发送mp3文件异常 #16

su-chang opened this issue Dec 28, 2020 · 10 comments
Labels

Comments

@su-chang
Copy link
Member

15:05:19 VERB Message say(FileBox#Base64<test.mp3>)
15:05:19 ERR Config ###########################
15:05:19 ERR Config unhandledRejection: Error: voiceLength is required
    at checkRequiredField (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/src/PadLocalClientApi.ts:9:11)
    at PadLocalClientApi.<anonymous> (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/src/PadLocalClientApi.ts:125:5)
    at Generator.next (<anonymous>)
    at /Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/dist/PadLocalClientApi.js:27:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/dist/PadLocalClientApi.js:23:12)
    at PadLocalClientApi.sendVoiceMessage (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/dist/PadLocalClientApi.js:135:16)
    at PuppetPadlocal.messageSendFile (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/wechaty-puppet-padlocal/src/puppet-padlocal.ts:737:48)
    at process._tickCallback (internal/process/next_tick.js:68:7) [object Promise]
15:05:19 ERR Config ###########################
15:05:19 ERR Config process.on(unhandledRejection) promise.catch(voiceLength is required)
Config Error: voiceLength is required
    at checkRequiredField (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/src/PadLocalClientApi.ts:9:11)
    at PadLocalClientApi.<anonymous> (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/src/PadLocalClientApi.ts:125:5)
    at Generator.next (<anonymous>)
    at /Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/dist/PadLocalClientApi.js:27:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/dist/PadLocalClientApi.js:23:12)
    at PadLocalClientApi.sendVoiceMessage (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/dist/PadLocalClientApi.js:135:16)
    at PuppetPadlocal.messageSendFile (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/wechaty-puppet-padlocal/src/puppet-padlocal.ts:737:48)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:18068) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 5)
@su-chang su-chang mentioned this issue Dec 28, 2020
18 tasks
@padlocal
Copy link
Collaborator

padlocal commented Jan 1, 2021

发送 mp3 是应该当作文件发送吧?如果是发送语音,Error: voiceLength is required 需要提供语音时长信息。

@su-chang
Copy link
Member Author

su-chang commented Jan 3, 2021

对的,mp3 是需要当做文件发送。

@padlocal
Copy link
Collaborator

padlocal commented Jan 6, 2021

fixed in wechaty-puppet-padlocal@0.2.19

@su-chang
Copy link
Member Author

su-chang commented Jan 6, 2021

20:41:18 VERB Message say(FileBox#Base64<test.mp3>)
20:42:18 ERR Config ###########################
20:42:19 ERR Config unhandledRejection: VError: [tid:700951a3] request has been cancelled for reason: SERVER_ERROR: 4 DEADLINE_EXCEEDED: Deadline exceeded
    at Request._failAllPendingRequest (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/src/Request.ts:309:15)
    at ClientDuplexStreamImpl.Request._grpcStream.on (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/padlocal-client-ts/src/Request.ts:72:12)
    at ClientDuplexStreamImpl.emit (events.js:198:13)
    at ClientDuplexStreamImpl.EventEmitter.emit (domain.js:448:20)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client.ts:666:18)
    at Object.onReceiveStatus (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/client-interceptors.ts:387:48)
    at process.nextTick (/Users/suchang/Desktop/PROJECT/Test/testPuppet/node_modules/@grpc/grpc-js/src/call-stream.ts:243:24)
    at process._tickCallback (internal/process/next_tick.js:61:11) [object Promise]

发送多次后,只有前几次出现这个报错,之后是能正常发送

20:52:43 VERB Message say(FileBox#Base64<test.mp3>)
20:53:32 VERB Message static load(7195784062271612956)
20:53:32 VERB Message constructor(7195784062271612956) for class WechatifiedMessage
20:53:32 VERB Message ready()
20:53:32 VERB Puppet messagePayload(7195784062271612956)
20:53:32 SILL Puppet messagePayloadCache(7195784062271612956) cache MISS
20:53:32 SILL Puppet messagePayload(7195784062271612956) cache SET
20:53:32 SILL Contact ready() @ Puppet#0<PuppetPadlocal>() with id="wxid_q0yib0cg8b2s22"
20:53:32 SILL Contact ready() isReady() true
20:53:32 SILL Contact ready() @ Puppet#0<PuppetPadlocal>() with id="Soul001001"
20:53:32 SILL Contact ready() isReady() true
msg: Message#Text[🗣Contact<小助手>]	[文件]

@fangmuke
Copy link

如果要把mp3当做语音发送,应该怎么做呢?有哪些限制嘛?

@padlocal
Copy link
Collaborator

Fixed, wechaty-puppet-padlocal@0.2.23

@padlocal
Copy link
Collaborator

如果要把mp3当做语音发送,应该怎么做呢?有哪些限制嘛?

  1. wx采用的是 silk 格式语音,可以参考 https://github.com/kn007/silk-v3-decoder 进行格式转换
  2. 时常最长 60 秒

@padlocal padlocal added the P0 label Jan 14, 2021
@fangmuke
Copy link

如果要把mp3当做语音发送,应该怎么做呢?有哪些限制嘛?

  1. wx采用的是 silk 格式语音,可以参考 https://github.com/kn007/silk-v3-decoder 进行格式转换
  2. 时常最长 60 秒

我尝试这样做了(使用 https://github.com/kn007/silk-v3-decoder 转换的slk/silk)但是发出来的是文件,是我使用的方式错误了吗?
image

@padlocal
Copy link
Collaborator

如果要把mp3当做语音发送,应该怎么做呢?有哪些限制嘛?

  1. wx采用的是 silk 格式语音,可以参考 https://github.com/kn007/silk-v3-decoder 进行格式转换
  2. 时常最长 60 秒

我尝试这样做了(使用 https://github.com/kn007/silk-v3-decoder 转换的slk/silk)但是发出来的是文件,是我使用的方式错误了吗?
image

It seems that you have sent voice successfully.

@padlocal padlocal reopened this Jan 28, 2021
@panlina
Copy link

panlina commented Jan 11, 2023

如果要把mp3当做语音发送,应该怎么做呢?有哪些限制嘛?

  1. wx采用的是 silk 格式语音,可以参考 https://github.com/kn007/silk-v3-decoder 进行格式转换
  2. 时常最长 60 秒

我尝试这样做了(使用 https://github.com/kn007/silk-v3-decoder 转换的slk/silk)但是发出来的是文件,是我使用的方式错误了吗? image

你后来有解决吗? @fangmuke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants