Skip to content

Commit

Permalink
fix sample exporter adding extraneous '.wav' if current extension is …
Browse files Browse the repository at this point in the history
…capitalized
  • Loading branch information
nikitalita committed Nov 1, 2024
1 parent 3175997 commit a5f04f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exporters/sample_exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ Error SampleExporter::_export_file(const String &out_path, const String &res_pat
}
err = gdre::ensure_dir(out_path.get_base_dir());
ERR_FAIL_COND_V_MSG(err != OK, err, "Failed to create dirs for " + out_path);
err = sample->save_to_wav(out_path);
// for some godforsaken reason, if the extension is capitalized, the wav saver will add a '.wav' to the end of the file, so we need to lowercase it
err = sample->save_to_wav(out_path.get_basename() + "." + out_path.get_extension().to_lower());
ERR_FAIL_COND_V_MSG(err != OK, err, "Could not save " + out_path);

return converted ? ERR_PRINTER_ON_FIRE : OK;
Expand Down

0 comments on commit a5f04f6

Please sign in to comment.