File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 6
6
import riva .client
7
7
from riva .client .argparse_utils import add_asr_config_argparse_parameters , add_connection_argparse_parameters
8
8
9
- import riva .client .audio_io
10
-
9
+ try :
10
+ import riva .client .audio_io
11
+ except ModuleNotFoundError as e :
12
+ print (f"ModuleNotFoundError: { e } " )
13
+ print ("Please install pyaudio from https://pypi.org/project/PyAudio" )
14
+ exit (1 )
11
15
12
16
def parse_args () -> argparse .Namespace :
13
17
default_device_info = riva .client .audio_io .get_default_input_device_info ()
Original file line number Diff line number Diff line change @@ -70,8 +70,13 @@ def parse_args() -> argparse.Namespace:
70
70
args = parser .parse_args ()
71
71
if args .output is not None :
72
72
args .output = args .output .expanduser ()
73
- if args .list_devices or args .output_device or args .play_audio :
74
- import riva .client .audio_io
73
+ try :
74
+ if args .list_devices or args .output_device or args .play_audio :
75
+ import riva .client .audio_io
76
+ except ModuleNotFoundError as e :
77
+ print (f"ModuleNotFoundError: { e } " )
78
+ print ("Please install pyaudio from https://pypi.org/project/PyAudio" )
79
+ exit (1 )
75
80
return args
76
81
77
82
You can’t perform that action at this time.
0 commit comments