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
Loading a WAV with metadata causes lime_sound_from_file to lockup on native #290
Comments
I am not sure if you are using the BEXT chunk in your WAV (the same issue I had). In my case, it was an SDL issue. I sent this fix a time ago to nme-dev and also directly to SDL: haxenme/nme-dev#2 , https://bugzilla.libsdl.org/show_bug.cgi?id=1673 |
That is an interesting premise! I examined the failing wave file, looking for a BEXT but instead I found this:
Comments are being stored in a RIFF INFO chunk. This is confirmed by reading up on Audacity meta-data. It's possible SDL could be responsible, but since INFO is wrapped in a LIST chunk, it appears to me that SDL_Wave.c is already skipping INFO chunks. Hrm! |
We should not be using SDL_mixer, OpenFL has been using OpenAL for audio for quite some time. If you don't mind, it would be helpful if you could check if the https://github.com/openfl/lime/blob/master/project/src/audio/format/WAV.cpp#L96 If there's an issue in here, then I can try and backport the fix to Lime legacy |
With -debug -Dnext the result is the same, the code freezes on Assets.getSound with no console output. Because the LIST chunk appears between fmt and data, I suspect the issue is with the seeking of the latter. When I look at the fmt section, the fmt chunk is progressively scanned using SEEK_CUR: if (wave_format.subChunkID[0] != 'f' || wave_format.subChunkID[1] != 'm' || wave_format.subChunkID[2] != 't' || wave_format.subChunkID[3] != ' ') {
lime::fseek (file, wave_data.subChunkSize, SEEK_CUR);
} else {
foundFormat = true;
} But the data section scrubs what appears to be the same position repeatedly using SEEK_SET, since currentHead does not change: if (wave_data.subChunkID[0] != 'd' || wave_data.subChunkID[1] != 'a' || wave_data.subChunkID[2] != 't' || wave_data.subChunkID[3] != 'a') {
lime::fseek (file, currentHead + sizeof (WAVE_Data) + wave_format.subChunkSize, SEEK_SET);
} else {
foundData = true;
} That would be my guess of the culprit. If data immediately follows fmt the code resolves, otherwise ∞. |
Got it :) |
Update Haxe 3.1.3 OS X Installer url.
I've only tested this with the comments field metadata set, and also only on mac and neko targets. Flash does not have an issue with these files.
I'm presuming this is an issue with lime_sound_from_file, which is why I'm reporting it here. For an example wave file with metadata, here's the bugger that was causing me to pull my hair out during the most recent Ludum Dare jam.
I accidentally left Audacity in a mode where it added the comment "From Ed's LP Collection" every time I exported a file. Sadly, Ed is no longer with us, but he enjoyed having access to his music in the time he had left, and probably would have been amused by this bug.
The text was updated successfully, but these errors were encountered: