-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing raw samples as input. #19
Conversation
Hello @harrynull, excellent work! :) Looks perfect to me. Have you tested it by running it with a raw file? |
Not yet, because CCAligner didn't work in Windows at the time I did it, and I also didn't have raw file sample to test it. But I will test it later if you didn't. |
@harrynull I am sending you a raw file in Slack DM. Please test it, I don't have a windows machine to try this. |
@@ -11,7 +11,7 @@ const std::string currentTime() | |||
time_t now = time(0); | |||
struct tm tstruct = * localtime(&now); | |||
std::string localTime; | |||
localTime.resize(19); //len(%d-%m-%Y-%H-%M-%S) | |||
localTime.resize(32); //len(%d-%m-%Y-%H-%M-%S) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harrynull Any specific reason, why this was changed? The string length is exact 19 characters?
It leads to
logPath : tempFiles/02-12-2017-11-49-42.log
phonemeLogPath : tempFiles/phoneme-02-12-2017-11-49-42.log
getting changed to :
logPath : tempFiles/02-12-2017-11-52-03�������������.log
phonemeLogPath : tempFiles/phoneme-02-12-2017-11-52-03�������������.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saurabhshri I don't know why it works in Linux, but you need at least 19+1(\0)==20 bytes to store the result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harrynull C++ strings do not need to end in NUL character :)
Unlike character array, which is simply an array of characters terminated by a NUL character, a string is a class which defines objects that be represented as stream of characters.
See the "String Length and Accessing Individual Elements" section at https://www.cprogramming.com/tutorial/string.html
Fixes #8 .