import bluetooth
target_name = "My Phone"
target_address = None
nearby_devices = bluetooth.discover_devices()
for bdaddr in nearby_devices:
if target_name == bluetooth.lookup_name( bdaddr ):
target_address = bdaddr
break
if target_address is not None:
print "found target bluetooth device with address ", target_address
else:
print "could not find target bluetooth device nearby"
不知道你是否还需要答案,但我正在研究类似的东西。 基本上是在windows平台上使用python从笔记本电脑的麦克风中录制流音频,然后将声音处理为ANC[自动噪声消除]并通过带通滤波器,然后将音频流输出到蓝牙设备。 我希望最终将其移植到智能手机上,但现在用Python进行原型制作要容易得多。在
虽然我还在项目的早期阶段,这里有两张图片可能会有帮助
1) 使用sounddevice将音频从麦克风传输到扬声器
录制外部音频并播放
请参阅此处的soundaudio模块安装详细信息
http://python-sounddevice.readthedocs.org/en/0.3.1/
2) 与蓝牙通信
请参阅此处的详细信息:
https://people.csail.mit.edu/albert/bluez-intro/c212.html
我知道我只是引用这些网站的例子,你可以参考这些网站来获得更多的见解。在
一旦我有了一个工作原型,我将尝试张贴在这里,在未来。在
相关问题 更多 >
编程相关推荐