-
Notifications
You must be signed in to change notification settings - Fork 141
Task Library: Added an offset param to the LoadAudioBufferFromFile C++ function for flexibility
#851
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
Task Library: Added an offset param to the LoadAudioBufferFromFile C++ function for flexibility
#851
Conversation
|
|
||
| absl::Status DecodeLin16WaveAsFloatVector(const std::string& wav_string, | ||
| std::vector<float>* float_values, | ||
| int offset, |
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.
Can you use uint32_t* here to align with the type of sample_count?
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.
The original data type for the offset was int though.
| int offset = 0; |
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.
Could you change it to uint32_t? It's better than int because offset can't be negative.
I think it'll require you to change the datatype for offset of underlying methods but I think it makes more sense to align the datatype of offset with that of sample_count through out the codebase.
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.
Alrighty, I'll make those changes.
|
@khanhlvg I've made some changes now. PTAL and let me know if it looks good. |
|
@khanhlvg I've fixed and addressed some of the feedback you've left FYI. Oh and I've also tested the 3 audio classifier files (C/C++/Python demo + test code) to ensure it runs fine now. |
khanhlvg
left a comment
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.
Thanks Kinar!
create_from_wav_filein the Python Task API