Skip to content

Commit

Permalink
ResourceImporterWAV: Compress WAV files to QOA by default
Browse files Browse the repository at this point in the history
  • Loading branch information
DeeJayLSP committed Aug 19, 2024
1 parent da5f398 commit 9c7a105
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/classes/ResourceImporterWAV.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<link title="Importing audio samples">$DOCS_URL/tutorials/assets_pipeline/importing_audio_samples.html</link>
</tutorials>
<members>
<member name="compress/mode" type="int" setter="" getter="" default="0">
<member name="compress/mode" type="int" setter="" getter="" default="2">
The compression mode to use on import.
[b]Disabled:[/b] Imports audio data without any compression. This results in the highest possible quality.
[b]RAM (Ima-ADPCM):[/b] Performs fast lossy compression on import. Low CPU cost, but quality is noticeably decreased compared to Ogg Vorbis or even MP3.
Expand Down
3 changes: 2 additions & 1 deletion editor/import/resource_importer_wav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ void ResourceImporterWAV::get_import_options(const String &p_path, List<ImportOp
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "edit/loop_mode", PROPERTY_HINT_ENUM, "Detect From WAV,Disabled,Forward,Ping-Pong,Backward", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "edit/loop_begin"), 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "edit/loop_end"), -1));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Disabled,RAM (Ima-ADPCM),QOA (Quite OK Audio)"), 0));
// QOA is lightweight enough and supports virtually every significant AudioStreamWAV feature.
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Disabled,RAM (Ima-ADPCM),QOA (Quite OK Audio)"), 2));
}

Error ResourceImporterWAV::import(const String &p_source_file, const String &p_save_path, const HashMap<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
Expand Down

0 comments on commit 9c7a105

Please sign in to comment.