forked from littlecodersh/ItChat
-
Notifications
You must be signed in to change notification settings - Fork 149
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
有发送语音的功能吗 #33
Comments
不可以,没有这个接口,网页端也无法发送语音 |
那能接受语音信息吗? |
可以呀,用 @itchat.msg_register(RECORDING)
def download_audio(msg):
# 检查并创建文件夹(如果不存在)
if not os.path.exists(chat_audio_directory):
os.makedirs(chat_audio_directory)
print(f"文件夹 {chat_audio_directory} 不存在,已创建。")
file_path = os.path.join(chat_audio_directory, msg.fileName)
try:
# 保存语音消息到本地
msg.download(f"{file_path}")
print(f"收到语音消息,已保存为 {file_path}")
except Exception as e:
print(e) |
感谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
可以发送微信语音吗
The text was updated successfully, but these errors were encountered: