敬请各位高手用python程序实现录屏和录音。谢谢
此python程序是放在电脑上,程序运行后则实时录下电脑屏幕上的画面和声音,并形成一个文件放在电脑里。
mm录屏和录音1.rar
(1016 Bytes)
python代码来自:https://yr7ywq.smartapps.baidu.com/?_chatQuery=python%E5%BD%95%E5%B1%8F%E5%BD%95%E9%9F%B3&searchid=14305264022513452839&_chatParams=%7B%22agent_id%22%3A%22c816%22%2C%22content_build_id%22%3A%223d4223e%22%2C%22from%22%3A%22q2c%22%2C%22token%22%3A%22UGlGZHdpN0lzYXNVbS9Gb1JoeVNNWXRmOGI3Q0R2VFNVZlJSWlMzOW9STDk3ZXBnMkFyYnVZdE1JWFdkbkV3RXZ5ZmZ1T1daaWdRSHFROTI1QTUzVzhpTkNIdmNRbkFyMDVkWjNCeldqaFV3dG5ocDc1bEpiZndtQlFKYi9VNG4%3D%22%2C%22chat_no_login%22%3Atrue%7D&tplname=ai_agent_distribute&srcid=1599&lid=c68681d600170727&order=3&_swebScene=3711000610001000
俺在网上搞的代码,弄成py文件运行后,IDLE显示的错误信息:
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
======= RESTART: C:\Users\Administrator\Desktop\截屏\新建文件夹 (2)\mm录屏和录音1.py =======
Exception in thread Thread-2:
Traceback (most recent call last):
File "E:\20190501\Python\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "E:\20190501\Python\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Administrator\Desktop\截屏\新建文件夹 (2)\mm录屏和录音1.py", line 38, in record_audio
sd.write(output_filename, fs, channels, myrecording)
AttributeError: module 'sounddevice' has no attribute 'write'
[此贴子已经被作者于2024-12-24 19:26编辑过]