跳转至

AudioCaptureStop 结束录音

格式

AudioCaptureStop()

简介

结束录音。

实例

按下鼠标左键时开始录音并保存为sound.wav放于文件列表根目录下,按下鼠标右键时结束录音。

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')
    if action == wx.ACTION.PRESS and button == wx.MOUSE_BUTTON.RIGHT:
        wx.AudioCaptureStop()

fg.AssetSetMouseButtonCBFunc(asset, onMouseButton)