<分区>
我可以使用 GStreamer(或其他与 Linux 兼容的声音库)检测麦克风上的吹气吗?
这样做我可以获得一些关于声音的信息:
import gtk, gst
def playerbinMessage(bus, message):
if message.type == gst.MESSAGE_ELEMENT:
struct = message.structure
if struct.get_name() == 'level':
# printing peak, decay, rms
print struct['peak'][0], struct['decay'][0], struct['rms'][0]
pipeline = gst.parse_launch('pulsesrc ! level ! filesink location=/dev/null')
bus = pipeline.get_bus()
bus.add_signal_watch()
bus.connect('message', playerbinMessage)
pipeline.set_state(gst.STATE_PLAYING)
gtk.main()
我用它来检测拍手,但我不知道我是否可以使用这些信息来检测吹气而不用我的计算机混淆吹气和说话。另外,我不知道是否有其他方法可以使用 GStreamer 或其他与 Linux 兼容的声音库分析声音。