@@ -78,21 +78,21 @@ std::shared_ptr<Channel> CreateChannel(const std::string& host) {
7878void PrintUsage () {
7979 std::cerr << " Usage: ./run_assistant_file "
8080 << " --input <audio_file> "
81- << " --credentials_file <credentials_file > "
82- << " [--credentials_type < " << kCredentialsTypeUserAccount << " >] "
81+ << " --output <audio_file > "
82+ << " --credentials <credentials_file> "
8383 << " [--api_endpoint <API endpoint>] "
8484 << " [--locale <locale>]"
8585 << std::endl;
8686}
8787
8888bool GetCommandLineFlags (
89- int argc, char ** argv, std::string* audio_input, std::string* credentials_file_path ,
90- std::string* credentials_type , std::string* api_endpoint,
89+ int argc, char ** argv, std::string* audio_input, std::string* audio_output ,
90+ std::string* credentials_file_path , std::string* api_endpoint,
9191 std::string* locale) {
9292 const struct option long_options[] = {
9393 {" input" , required_argument, nullptr , ' i' },
94- {" credentials_file " , required_argument, nullptr , ' f ' },
95- {" credentials_type " , required_argument, nullptr , ' c' },
94+ {" output " , required_argument, nullptr , ' o ' },
95+ {" credentials " , required_argument, nullptr , ' c' },
9696 {" api_endpoint" , required_argument, nullptr , ' e' },
9797 {" locale" , required_argument, nullptr , ' l' },
9898 {" verbose" , no_argument, nullptr , ' v' },
@@ -102,25 +102,19 @@ bool GetCommandLineFlags(
102102 while (true ) {
103103 int option_index;
104104 int option_char =
105- getopt_long (argc, argv, " i:f :c:e:l:v" , long_options, &option_index);
105+ getopt_long (argc, argv, " i:o :c:e:l:v" , long_options, &option_index);
106106 if (option_char == -1 ) {
107107 break ;
108108 }
109109 switch (option_char) {
110110 case ' i' :
111111 *audio_input = optarg;
112112 break ;
113- case ' f ' :
114- *credentials_file_path = optarg;
113+ case ' o ' :
114+ *audio_output = optarg;
115115 break ;
116116 case ' c' :
117- *credentials_type = optarg;
118- if (*credentials_type != kCredentialsTypeUserAccount ) {
119- std::cerr << " Invalid credentials_type: \" " << *credentials_type
120- << " \" . Should be \" " << kCredentialsTypeUserAccount
121- << " \" " << std::endl;
122- return false ;
123- }
117+ *credentials_file_path = optarg;
124118 break ;
125119 case ' e' :
126120 *api_endpoint = optarg;
@@ -140,20 +134,16 @@ bool GetCommandLineFlags(
140134}
141135
142136int main (int argc, char ** argv) {
143- std::string audio_input_source, credentials_file_path, credentials_type ,
137+ std::string audio_input_source, audio_output_source, credentials_file_path ,
144138 api_endpoint, locale;
145139 // Initialize gRPC and DNS resolvers
146140 // https://github.com/grpc/grpc/issues/11366#issuecomment-328595941
147141 grpc_init ();
148- if (!GetCommandLineFlags (argc, argv, &audio_input_source, &credentials_file_path,
149- &credentials_type, & api_endpoint, &locale)) {
142+ if (!GetCommandLineFlags (argc, argv, &audio_input_source, &audio_output_source, & credentials_file_path,
143+ &api_endpoint, &locale)) {
150144 return -1 ;
151145 }
152146
153- if (credentials_type.empty ()) {
154- credentials_type = kCredentialsTypeUserAccount ; // Default is USER_ACCOUNT
155- }
156-
157147 // Create an AssistRequest
158148 AssistRequest request;
159149 auto * assist_config = request.mutable_config ();
0 commit comments