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

Add support for AIFF files and other WAV formats #877

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Spartan322
Copy link
Member

(cherry picked from commit DeeJayLSP/godot@8345199)

Original PR: godotengine/godot#96545

Changes

In ResourceImporterWAV::import(), replaces the entire data read step with one that uses dr_wav.

Formats already supported by Godot and loop info detection should remain supported without regressions.

Extra WAV encoding formats like A-law, μ-law, MS ADPCM and IMA ADPCM can now be imported.

Note: All of them will be decoded on import, so any loss will be retained and passed to the compress modes, but at least a few WAV files won't be rejected anymore.

Note 2: Even if Godot is able to compress and play audio as IMA ADPCM, the way it's compressed within Godot doesn't match the usual compression done in WAV files, so those couldn't be imported anyway, unless a compatibility breaking change is done to modify how Godot encodes and plays it.

AIFF support

dr_wav is also able to read AIFF files, so ResourceImporterWAV was enabled to recognize it too.

The importer was renamed from Microsoft WAV to Microsoft WAV/Apple AIFF to reflect that.

When it comes to sound effects, freesound.org provides much more AIFF than Ogg Vorbis files, so I thought adding support was reasonable:
image

wave, aif, aiff and aifc file extensions have been added as recognized extensions alongside wav.

Others

Since both AudioStreamWAV and ResourceImporterWAV use a 32-bit integer variable to store the amount of PCM frames, I added a check that denies import if the number of frames exceed INT32_MAX. This doesn't break compatibility, as attempting to import a file bigger than that would likely crash the editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants