Skip to content

Commit

Permalink
enhance error message on audio file processing (#902)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenbingl authored Mar 3, 2025
1 parent ee945bb commit d374c03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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

0 comments on commit d374c03

Please sign in to comment.