跳转至

AudioCaptureIsRunning 录音中

格式

AudioCaptureIsRunning()

简介

返回是否正在录音中。

返回值

类型 描述
bool True为正在录音;False为不在录音

实例

按下鼠标左键时开始录音,在日志区打印录音状态(打印结果为True);按下鼠标右键时结束录音,在日志区打印录音状态(打印结果为False)。

import fg,wx

asset = fg.AssetCreate()
asset.name = 'Main Scene'
asset.state = fg.STATE.VOXMODEL
asset.vmFile = 'mainScene'
asset.icon='icon.png'

fg.AssetRegister(asset)

def onMouseButton(self, stamp, button, action, mods):
    if action == wx.ACTION.PRESS and button == wx.MOUSE_BUTTON.LEFT:
        wx.AudioCaptureStart('sound.wav')
        print(wx.AudioCaptureIsRunning())
    if action == wx.ACTION.PRESS and button == wx.MOUSE_BUTTON.RIGHT:
        wx.AudioCaptureStop()
        print(wx.AudioCaptureIsRunning())

fg.AssetSetMouseButtonCBFunc(asset, onMouseButton)