Skip to content
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

Enhance error message on audio file processing #902

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion operators/audio/audio_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ OrtxStatus AudioDecoder::ComputeInternal(const ortc::Tensor<uint8_t>& input, con
str_format = *format;
}
auto stream_format = ReadStreamFormat(p_data, str_format, status);
if (status) {
if (!status.IsOk()) {
return status;
}

Expand Down
4 changes: 4 additions & 0 deletions shared/api/c_api_feature_extraction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ extError_t ORTX_API_CALL OrtxLoadAudios(OrtxRawAudios** raw_audios, const char*
auto audios_obj = std::make_unique<RawAudiosObject>();
auto [audios, num] =
ort_extensions::LoadRawData<char const* const*, AudioRawData>(audio_paths, audio_paths + num_audios);
if (num == 0) {
ReturnableStatus::last_error_message_ = "No audio data loaded";
return kOrtxErrorInvalidArgument;
}
audios_obj->audios_ = std::move(audios);
audios_obj->num_audios_ = num;

Expand Down