本文整理汇总了Python中CeciliaLib.getAvailableAudioOutputs方法的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib.getAvailableAudioOutputs方法的具体用法?Python CeciliaLib.getAvailableAudioOutputs怎么用?Python CeciliaLib.getAvailableAudioOutputs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CeciliaLib
的用法示例。
在下文中一共展示了CeciliaLib.getAvailableAudioOutputs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createPortaudioPane
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getAvailableAudioOutputs [as 别名]
def createPortaudioPane(self, panel):
portaudioPanel = wx.Panel(panel)
portaudioPanel.SetBackgroundColour(BACKGROUND_COLOUR)
gridSizer = wx.FlexGridSizer(5, 3, 5, 5)
# Input
textIn = wx.StaticText(portaudioPanel, 0, 'Input Device :')
textIn.SetFont(self.font)
availableAudioIns = []
for d in CeciliaLib.getAvailableAudioInputs():
availableAudioIns.append(CeciliaLib.ensureNFD(d))
if CeciliaLib.getAudioInput() != '':
try:
initInput = availableAudioIns[int(CeciliaLib.getAudioInput())]
except:
initInput = 'dump'
else:
initInput = 'dump'
self.choiceInput = CustomMenu(portaudioPanel, choice=availableAudioIns,
init=initInput, size=(168,20),
outFunction=self.changeAudioInput)
if CeciliaLib.getAudioInput() == '' or CeciliaLib.getEnableAudioInput() == 0:
initInputState = 0
else:
initInputState = 1
self.inputToggle = Toggle(portaudioPanel, initInputState,
outFunction=self.enableAudioInput)
# Output
textOut = wx.StaticText(portaudioPanel, 0, 'Output Device :')
textOut.SetFont(self.font)
availableAudioOuts = []
for d in CeciliaLib.getAvailableAudioOutputs():
availableAudioOuts.append(CeciliaLib.ensureNFD(d))
try:
initOutput = availableAudioOuts[int(CeciliaLib.getAudioOutput())]
except:
initOutput = availableAudioOuts[0]
self.choiceOutput = CustomMenu(portaudioPanel, choice=availableAudioOuts,
init=initOutput, size=(168,20), outFunction=self.changeAudioOutput)
gridSizer.AddMany([
(textIn, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(self.inputToggle, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 45),
(self.choiceInput, 0, wx.ALIGN_CENTER_VERTICAL),
(textOut, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(wx.StaticText(portaudioPanel, -1, '', size=(65,-1)), 1, wx.EXPAND),
(self.choiceOutput, 0, wx.ALIGN_CENTER_VERTICAL),
])
gridSizer.AddGrowableCol(1, 1)
portaudioPanel.SetSizerAndFit(gridSizer)
return portaudioPanel
示例2: updateAudioInOut
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getAvailableAudioOutputs [as 别名]
def updateAudioInOut(self):
CeciliaLib.queryAudioMidiDrivers()
inputs = CeciliaLib.getAvailableAudioInputs()
outputs = CeciliaLib.getAvailableAudioOutputs()
if inputs == []:
self.choiceInput.setChoice([''])
else:
self.choiceInput.setChoice(inputs)
if CeciliaLib.getAudioInput()=='':
self.inputToggle.setValue(0)
else:
self.inputToggle.setValue(1)
self.choiceInput.setByIndex(int(CeciliaLib.getAudioInput()))
if outputs == []:
self.choiceOutput.setChoice([''])
else:
self.choiceOutput.setChoice(outputs)
self.choiceOutput.setByIndex(int(CeciliaLib.getAudioOutput()))