Skip to content

Commit b773f7a

Browse files
committed
clean up
1 parent ab0bfdf commit b773f7a

File tree

1 file changed

+13
-25
lines changed

1 file changed

+13
-25
lines changed

src/viam/examples/modules/audioin/client.cpp

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,22 @@ int main() {
1818
// any other C++ SDK objects and stays alive until all Viam C++ SDK objects are destroyed.
1919
Instance inst;
2020

21-
std::string host("xarm-main.aqb785vhl4.viam.cloud");
22-
DialOptions dial_opts;
23-
dial_opts.set_entity(std::string("88dcef8e-db7f-47dc-9b0f-eb08fdc5a97d"));
21+
auto machine = RobotClient::at_address(host, options);
2422

25-
Credentials credentials("api-key", "eou798fi90d1fytv66c9lntv1ndwxj4g");
23+
// Update these with your robot's connection details
24+
const char* uri = ""; // replace with your robot's URI
25+
DialOptions dial_options;
26+
dial_options.set_allow_insecure_downgrade(true); // set to false if connecting securely
2627

27-
dial_opts.set_credentials(credentials);
28-
boost::optional<DialOptions> opts(dial_opts);
29-
Options options(0, opts);
28+
// Uncomment and fill out your credentials details if connecting securely
29+
// std::string type = "api-key";
30+
// std::string payload = "your-api-key-here";
31+
// Credentials credentials(type, payload);
32+
// dial_options.set_credentials(credentials);
3033

31-
// auto machine = RobotClient::at_address(host, options);
32-
33-
// // Update these with your robot's connection details
34-
// const char* uri = ""; // replace with your robot's URI
35-
// DialOptions dial_options;
36-
// dial_options.set_allow_insecure_downgrade(true); // set to false if connecting securely
37-
38-
// // Uncomment and fill out your credentials details if connecting securely
39-
// // std::string type = "api-key";
40-
// // std::string payload = "your-api-key-here";
41-
// // Credentials credentials(type, payload);
42-
// // dial_options.set_credentials(credentials);
43-
44-
// boost::optional<DialOptions> opts(dial_options);
45-
// std::string address(uri);
46-
// Options options(1, opts);
34+
boost::optional<DialOptions> opts(dial_options);
35+
std::string address(uri);
36+
Options options(1, opts);
4737

4838
std::shared_ptr<RobotClient> robot = RobotClient::at_address(host, options);
4939

@@ -117,7 +107,6 @@ int main() {
117107
outfile.write(reinterpret_cast<const char*>(&chunk_size), 4);
118108
outfile.write("WAVE", 4);
119109

120-
// fmt sub-chunk
121110
outfile.write("fmt ", 4);
122111
uint32_t subchunk1_size = 16; // PCM
123112
outfile.write(reinterpret_cast<const char*>(&subchunk1_size), 4);
@@ -129,7 +118,6 @@ int main() {
129118
outfile.write(reinterpret_cast<const char*>(&block_align), 2);
130119
outfile.write(reinterpret_cast<const char*>(&bits_per_sample), 2);
131120

132-
// data sub-chunk
133121
outfile.write("data", 4);
134122
outfile.write(reinterpret_cast<const char*>(&data_size), 4);
135123
outfile.write(reinterpret_cast<const char*>(all_audio_data.data()), data_size);

0 commit comments

Comments
 (0)