没有获取接收语音消息
没有获取接收语音消息
接收语音消息
$wechat = new Wechat([
// 开发者中心-配置项-AppID(应用ID)
'appId' => 'wx733d7f24bd29224a',
// 开发者中心-配置项-服务器配置-Token(令牌)
'token' => 'gaoming13',
// 开发者中心-配置项-服务器配置-EncodingAESKey(消息加解密密钥)
// 可选: 消息加解密方式勾选 兼容模式 或 安全模式 需填写
'encodingAESKey' => '072vHYArTp33eFwznlSvTRvuyOTe5YME1vxSoyZbzaV'
]);
// 获取微信消息
$msg = $wechat->serve();
// 接收语音消息
if ($msg['MsgType'] == 'voice') {
var_dump($msg);
// $msg 的结构体参考微信文档:
// https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html #语音消息
$wechat->reply("你也好!");
} else {
$wechat->reply("听不懂!");
}
被动回复语音消息
// https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html#2
$wechat->reply([
'type' => 'voice',
'media_id' => 'rVT43tfDwjh4p1BV2gJ5D7Zl2BswChO5L_llmlphLaTPytcGcguBAEJ1qK4cg4r_'
]);
主动发送语音消息
// https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html
$api->send('ocNtAt_K8nRlAdmNEo_R0WVg_rRw', [
'type' => 'voice',
'media_id' => 'rVT43tfDwjh4p1BV2gJ5D7Zl2BswChO5L_llmlphLaTPytcGcguBAEJ1qK4cg4r_'
]);
语音识别。接收到的语音信息是空白的...
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年6月21日(星期一) 上午9:51 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [gaoming13/wechat-php-sdk] 没有获取接收语音消息 (#27)
接收语音消息 $wechat = new Wechat([ // 开发者中心-配置项-AppID(应用ID) 'appId' => 'wx733d7f24bd29224a', // 开发者中心-配置项-服务器配置-Token(令牌) 'token' => 'gaoming13', // 开发者中心-配置项-服务器配置-EncodingAESKey(消息加解密密钥) // 可选: 消息加解密方式勾选 兼容模式 或 安全模式 需填写 'encodingAESKey' => '072vHYArTp33eFwznlSvTRvuyOTe5YME1vxSoyZbzaV' ]); // 获取微信消息 $msg = $wechat->serve(); // 接收语音消息 if ($msg['MsgType'] == 'voice') { var_dump($msg); // $msg 的结构体参考微信文档: // https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html #语音消息 $wechat->reply("你也好!"); } else { $wechat->reply("听不懂!"); }
被动回复语音消息 // https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html#2 $wechat->reply([ 'type' => 'voice', 'media_id' => 'rVT43tfDwjh4p1BV2gJ5D7Zl2BswChO5L_llmlphLaTPytcGcguBAEJ1qK4cg4r_' ]);
主动发送语音消息 // https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html $api->send('ocNtAt_K8nRlAdmNEo_R0WVg_rRw', [ 'type' => 'voice', 'media_id' => 'rVT43tfDwjh4p1BV2gJ5D7Zl2BswChO5L_llmlphLaTPytcGcguBAEJ1qK4cg4r_' ]);
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
语音识别接口还是有问题$msg['Recognition'],0,-3)
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年6月21日(星期一) 上午9:51 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [gaoming13/wechat-php-sdk] 没有获取接收语音消息 (#27)
接收语音消息 $wechat = new Wechat([ // 开发者中心-配置项-AppID(应用ID) 'appId' => 'wx733d7f24bd29224a', // 开发者中心-配置项-服务器配置-Token(令牌) 'token' => 'gaoming13', // 开发者中心-配置项-服务器配置-EncodingAESKey(消息加解密密钥) // 可选: 消息加解密方式勾选 兼容模式 或 安全模式 需填写 'encodingAESKey' => '072vHYArTp33eFwznlSvTRvuyOTe5YME1vxSoyZbzaV' ]); // 获取微信消息 $msg = $wechat->serve(); // 接收语音消息 if ($msg['MsgType'] == 'voice') { var_dump($msg); // $msg 的结构体参考微信文档: // https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html #语音消息 $wechat->reply("你也好!"); } else { $wechat->reply("听不懂!"); }
被动回复语音消息 // https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html#2 $wechat->reply([ 'type' => 'voice', 'media_id' => 'rVT43tfDwjh4p1BV2gJ5D7Zl2BswChO5L_llmlphLaTPytcGcguBAEJ1qK4cg4r_' ]);
主动发送语音消息 // https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html $api->send('ocNtAt_K8nRlAdmNEo_R0WVg_rRw', [ 'type' => 'voice', 'media_id' => 'rVT43tfDwjh4p1BV2gJ5D7Zl2BswChO5L_llmlphLaTPytcGcguBAEJ1qK4cg4r_' ]);
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
您好,gaoming。你的sdk包非常出色。我使用了sdk包,却出现了这个问题: 该公众号提供的服务出现故障,请稍后再试
可有解决办法?感谢