-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add check for audio sampling rate other than 8k or 16k Hz #898
Conversation
shared/api/speech_features.hpp
Outdated
|
||
// Currently we only support 8k and 16k Hz sampling rate. | ||
if (sr_val != 8000 && sr_val != 16000){ | ||
ORTX_CXX_API_THROW("ort-extensions internal error: currently only 8k and 16k Hz sampling rate is supported. Please resample your audio file to either 8k or 16k.", ORT_RUNTIME_EXCEPTION); |
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.
to be more Ort-Mobile friendly and be consistent, please try to return the error status, instead of throwing an exception.
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.
Also, could we avoid adding library's name in the error message reported? To the end user, it may be confusing to see ort-extensions error if there are multiple libraries involved: win-ai-gallery -> aitk -> ort-genai -> ort-extensions ...
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.
Also, could we avoid adding library's name in the error message reported? To the end user, it may be confusing to see ort-extensions error if there are multiple libraries involved: win-ai-gallery -> aitk -> ort-genai -> ort-extensions ...
on calling ort-extensions from ort-genai, only error code and error message are expected. so, ort-genai can add whatever prefix for the error message from ort-extensions or filtering error message, but it will be lack of information if we got some error report from the user
it would be nice if there is an error report which can be posted into ort-extensions issue to fully understanding the issue. Typically, the audio format should be handled audio-decoder. |
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.
Not sure if this change is related to the issue mentioned in the description, but the checker is good.
Fixes issue where user was getting vague error when using audio file with 48k Hz sampling rate:
onnxruntime-extensions/include/ort_c_to_cpp.h
Line 109 in 0d5aefa