| Summary: | BEXT wave files only have extra metadata that you can easily skip through | ||
|---|---|---|---|
| Product: | SDL | Reporter: | bill <bill.sherif> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | trivial | ||
| Priority: | P2 | CC: | madrazoman, renesd |
| Version: | 1.2.6 | ||
| Hardware: | x86 | ||
| OS: | Windows 7 | ||
| Attachments: |
SDL_wave.c with BEXT chunk
A patch version of the fix. |
||
Do you have a sample save file, and a patch to fix this? Thanks! Created attachment 1664 [details]
SDL_wave.c with BEXT chunk
#define BEXT 0x74786562 /* "bext" */
Hi, I got a workaround for this issue (see attachment). The format is called BWF (which are the same as BEXT) (http://en.wikipedia.org/wiki/Broadcast_Wave_Format) I was getting the error: "Error in music Complex WAVE files not supported" It can be solved by just skipping these chunks. In SDL_wave.c, replace } while ((chunk.magic == FACT) || (chunk.magic == LIST)); with } while ((chunk.magic == FACT) || (chunk.magic == LIST) || (chunk.magic == BEXT)); In SDL_wave.h define BEXT as: #define BEXT 0x74786562 /* "bext" */ Other chunks are indicated in the Wikipedia page, but this was enough for me. I kindly request you to add this change. Thank you very much. Fixed, thanks! https://hg.libsdl.org/SDL/rev/a894224dc538 Created attachment 3273 [details]
A patch version of the fix.
Attaching a patch here just to make it slightly easier for others to read and download (Some people from: homebrew, archlinux, and pygame).
|
In SDL_wave.c, BEXT wave files with "bext" instead of "fmt " are choked on if (chunk.magic != FMT) { SDL_SetError("Complex WAVE files not supported"); was_error = 1; goto done; } BEXT files http://en.wikipedia.org/wiki/Broadcast_Wave_Format actually playback the same as regular waves. All they have is (A LOT OF) extra header info. To open them, just SKIP the "bext" chunk, and the "fmt " chunk will be a couple of hundred bytes later. The "fmt " chunk is also bloated, but if you skip past the extra information to the "data" chunk, there is nothing different about a BEXT wave file than a "normal" one. You can then load the data and proceed as normal.