audio: split library load from c-tor

This commit is contained in:
Roman Zeyde
2015-01-17 19:00:20 +02:00
parent 2d202cf587
commit 3b6a54150f
3 changed files with 33 additions and 28 deletions

View File

@@ -14,10 +14,8 @@ def test():
lib.Pa_GetDefaultInputDevice.return_value = 2
lib.Pa_OpenStream.return_value = 0
cdll.return_value = lib
interface = audio.Interface(
name='portaudio', config=config.fastest(), debug=True
)
with interface:
interface = audio.Interface(config=config.fastest(), debug=True)
with interface.load(name='portaudio'):
s = interface.player()
assert s.params.device == 1
s.stream = 1 # simulate non-zero output stream handle