Audio files, file format problem, and tools to fix it..
Posted: Thu Apr 17, 2014 8:45 am
INTRODUCTION
Battlefield uses specific variation of wave file format. This can easily cause issues with creating audio samples with newer audio software, and samples are not played in the game as expected. To make sure your audio is in the correct format it is recommended to use Audacity 1.0.0 (see links to download below) as a final step before adding the wave file to the map. In other words: the sound sample you made in software x, saved in wave format should be opened in Audacity 1.0.0 and then saved again as the wave file you are gone use in map. (u can use Audacity 1.2.6 to convert between 11,22,44khz, and do your editing, then use Audacity 1.0.0 to make sure it is in the format Battlefield likes).
BACKGROUND/TECHNICAL
A lot of things in regards to Battlefield 1942 have had some old school thinking in regards to performance and techniques; if this is one of them or just a stuff up is hard to tell. But when the game loads wave files it expects the DATA entry in the wave file to follow right after the WAVE identifier. Getting a bit technical here.. but simply, the wave file or RIFF format (http://en.wikipedia.org/wiki/WAV) can have different chunks of information within.
Battlefield expects data to be the early on, and does not have the ability to process other chunks. So when it sees an unknown chunk it gives up and calls it an error. This is typical for newer audio editing software to add more chunks in there, while in the old days they kept it simple. Maybe they just made the decision that for performance reasons they removed all other irrelevant chunks.
Example 1: Bad WAVE file in battlefield (SOCRAWL2.wav)
Typical errors in the log file when running the debug exe:
Engine\SfxPc\Sample.cpp(110): . . . . Sound/44kHz/SOCRAWL2.wav Error: Non PCM format.
Engine\SfxPc\Sample.cpp(132): . . . . Sound/44kHz/SOCRAWL2.wav is corrupt. Error: Keyword 'data' not found.
Data in the audio file, notice the JUNK header before DATA header and the reason why Battlefield gets grumpy..
Offset(h) 00 04 08 0C 10 14 18 1C
00000000 52494646 D8780000 57415645 666D7420 12000000 01000100 44AC0000 88580100 RIFFØx..WAVEfmt ........D..ˆX..
00000020 02001000 00004A55 4E4BCA01 00000000 00000000 00000000 00000000 00000000 ......JUNKÊ.....................
00000040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ................................
00000060 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ................................
....
000001E0 00000000 00000000 00000000 00000000 00000000 00000000 64617461 30760000 ........................data0v..
00000200 BC014802 9802AB02 FB029803 F803E003 E4037504 34058905 79054E05 02055F04 ¼.H.˜.".û.˜.ø.à.ä.u.4.‰.y.N..._.
Example 2: How battlefield likes it (SOCRAWL1.wav)
Notice how the DATA field comes right after WAVE keyword.
Offset(h) 00 04 08 0C 10 14 18 1C
00000000 52494646 92730000 57415645 666D7420 10000000 01000100 44AC0000 88580100 RIFF's..WAVEfmt ........D..ˆX..
00000020 02001000 64617461 BE720000 9900D900 2501FB00 7D007500 FD005401 39010F01 ....data¾r..™.Ù.%.û.}.u.ý.T.9...
00000040 A80097FF 99FED4FE 9EFF8EFF 64FFC200 6C029501 09FF6AFE 06006E00 0DFF6FFF ¨.-ÿ™þÔþžÿŽÿdÿÂ.l.o..ÿjþ..n..ÿoÿ
00000060 2E02D602 B1FF83FD 9FFF0B02 850000FE 56FFCC02 2C036E00 FDFE0000 9E00E7FF ..Ö.±ÿƒýŸÿ..…..þVÿÌ.,.n.ýþ..ž.çÿ
00000080 2000C801 2B020E00 1BFED6FE F0005701 83FFF9FD D3FEFB00 D701D300 0200C600 .È.+....þÖþð.W.ƒÿùýÓþû.×.Ó...Æ.
TOOLS AND DOWNLOADS
Download Audacity (free)
1.0.0 http://sourceforge.net/projects/audacit ... ity/1.0.0/
1.2.6 http://sourceforge.net/projects/audacit ... ity/1.2.6/
Best to download the zip files, and extract them manually.
Create a folder in "Program Files" called /Audacity100 and /Audacity126, dump the contents of each zip file in respective folders. And drag a shortcut of the exe (hold ALT while dragging) to your desktop.
Hex editor (free) (not needed, but a good tool for the curious)
http://mh-nexus.de/en/hxd/
Battlefield uses specific variation of wave file format. This can easily cause issues with creating audio samples with newer audio software, and samples are not played in the game as expected. To make sure your audio is in the correct format it is recommended to use Audacity 1.0.0 (see links to download below) as a final step before adding the wave file to the map. In other words: the sound sample you made in software x, saved in wave format should be opened in Audacity 1.0.0 and then saved again as the wave file you are gone use in map. (u can use Audacity 1.2.6 to convert between 11,22,44khz, and do your editing, then use Audacity 1.0.0 to make sure it is in the format Battlefield likes).
BACKGROUND/TECHNICAL
A lot of things in regards to Battlefield 1942 have had some old school thinking in regards to performance and techniques; if this is one of them or just a stuff up is hard to tell. But when the game loads wave files it expects the DATA entry in the wave file to follow right after the WAVE identifier. Getting a bit technical here.. but simply, the wave file or RIFF format (http://en.wikipedia.org/wiki/WAV) can have different chunks of information within.
Battlefield expects data to be the early on, and does not have the ability to process other chunks. So when it sees an unknown chunk it gives up and calls it an error. This is typical for newer audio editing software to add more chunks in there, while in the old days they kept it simple. Maybe they just made the decision that for performance reasons they removed all other irrelevant chunks.
Example 1: Bad WAVE file in battlefield (SOCRAWL2.wav)
Typical errors in the log file when running the debug exe:
Engine\SfxPc\Sample.cpp(110): . . . . Sound/44kHz/SOCRAWL2.wav Error: Non PCM format.
Engine\SfxPc\Sample.cpp(132): . . . . Sound/44kHz/SOCRAWL2.wav is corrupt. Error: Keyword 'data' not found.
Data in the audio file, notice the JUNK header before DATA header and the reason why Battlefield gets grumpy..
Offset(h) 00 04 08 0C 10 14 18 1C
00000000 52494646 D8780000 57415645 666D7420 12000000 01000100 44AC0000 88580100 RIFFØx..WAVEfmt ........D..ˆX..
00000020 02001000 00004A55 4E4BCA01 00000000 00000000 00000000 00000000 00000000 ......JUNKÊ.....................
00000040 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ................................
00000060 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ................................
....
000001E0 00000000 00000000 00000000 00000000 00000000 00000000 64617461 30760000 ........................data0v..
00000200 BC014802 9802AB02 FB029803 F803E003 E4037504 34058905 79054E05 02055F04 ¼.H.˜.".û.˜.ø.à.ä.u.4.‰.y.N..._.
Example 2: How battlefield likes it (SOCRAWL1.wav)
Notice how the DATA field comes right after WAVE keyword.
Offset(h) 00 04 08 0C 10 14 18 1C
00000000 52494646 92730000 57415645 666D7420 10000000 01000100 44AC0000 88580100 RIFF's..WAVEfmt ........D..ˆX..
00000020 02001000 64617461 BE720000 9900D900 2501FB00 7D007500 FD005401 39010F01 ....data¾r..™.Ù.%.û.}.u.ý.T.9...
00000040 A80097FF 99FED4FE 9EFF8EFF 64FFC200 6C029501 09FF6AFE 06006E00 0DFF6FFF ¨.-ÿ™þÔþžÿŽÿdÿÂ.l.o..ÿjþ..n..ÿoÿ
00000060 2E02D602 B1FF83FD 9FFF0B02 850000FE 56FFCC02 2C036E00 FDFE0000 9E00E7FF ..Ö.±ÿƒýŸÿ..…..þVÿÌ.,.n.ýþ..ž.çÿ
00000080 2000C801 2B020E00 1BFED6FE F0005701 83FFF9FD D3FEFB00 D701D300 0200C600 .È.+....þÖþð.W.ƒÿùýÓþû.×.Ó...Æ.
TOOLS AND DOWNLOADS
Download Audacity (free)
1.0.0 http://sourceforge.net/projects/audacit ... ity/1.0.0/
1.2.6 http://sourceforge.net/projects/audacit ... ity/1.2.6/
Best to download the zip files, and extract them manually.
Create a folder in "Program Files" called /Audacity100 and /Audacity126, dump the contents of each zip file in respective folders. And drag a shortcut of the exe (hold ALT while dragging) to your desktop.
Hex editor (free) (not needed, but a good tool for the curious)
http://mh-nexus.de/en/hxd/