summaryrefslogtreecommitdiff
path: root/sound_detector/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sound_detector/main.cpp')
-rw-r--r--sound_detector/main.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound_detector/main.cpp b/sound_detector/main.cpp
index 1385eea..6bffcb6 100644
--- a/sound_detector/main.cpp
+++ b/sound_detector/main.cpp
@@ -38,6 +38,7 @@
#include <limits>
#include <vector>
#include <fstream>
+#include <string>
//portaudio
#include <portaudio.h>
@@ -155,7 +156,7 @@ std::string time_str()
#endif
}
-char out_dir[1024] = {0};
+std::string out_dir;
void handle_data()
@@ -322,7 +323,7 @@ int main(int argc, char **argv)
stop_thresold_percent = strtof(optarg, NULL);
break;
case 'o':
- strcpy(out_dir, optarg);
+ out_dir = optarg;
break;
case 'd':
device = atoi(optarg);
@@ -347,7 +348,7 @@ int main(int argc, char **argv)
printf("ERROR: device number is required\n");
return 1;
}
- if(!out_dir[0])
+ if(out_dir.empty())
{
printf("ERROR: output directory is required\n");
return 1;