mirror of
https://github.com/romanz/amodem.git
synced 2026-04-21 05:36:42 +08:00
__main__: fix dummy interface case
This commit is contained in:
@@ -218,6 +218,13 @@ def _main():
|
|||||||
if args.audio_library == 'ALSA':
|
if args.audio_library == 'ALSA':
|
||||||
from . import alsa
|
from . import alsa
|
||||||
interface = alsa.Interface(config)
|
interface = alsa.Interface(config)
|
||||||
|
elif args.audio_library == '-':
|
||||||
|
class _DummyInterface(object):
|
||||||
|
def __enter__(self):
|
||||||
|
return self
|
||||||
|
def __exit__(self, *args):
|
||||||
|
pass
|
||||||
|
interface = _DummyInterface()
|
||||||
else:
|
else:
|
||||||
interface = audio.Interface(config)
|
interface = audio.Interface(config)
|
||||||
interface.load(args.audio_library)
|
interface.load(args.audio_library)
|
||||||
|
|||||||
Reference in New Issue
Block a user