View Full Version : ATRAC3Plus .WAV files: how to unbork them
filler56789
10th June 2021, 04:50
As everybody already knows, since Sony released the command-line .EXEs at3tool and PS3at3tool ages ago,
it's possible for anyone to convert 16-bit 44.1 & 48 kHz PCM audio to .WAV-wrapped atrac3plus streams.
The problem is, such .WAV files contain an irregular FACT chunk, which "confuses" the normal AVI muxers and makes these generate broken .AVI files.
So those borked .WAV files must be fixed through a hex editor.
In a "normal" 44.1 kHz at3+ WAV, the dwSampleLength field is 8 bytes long and the cksize field says "08 00 00 00".
In a "normal" 48 kHz at3+ WAV, the dwSampleLength field is 12 bytes long and the cksize field says "0C 00 00 00".
So all one has to do is
1) delete the last 4 or 8 bytes between the actual dwSampleLength value and the data chunk
&&
2) overwrite "08" or "0C" with "04" in the cksize field.
Then the fixed at3+ .WAV file is processed normally by VirtualDub
— but not by AVI-Mux GUI nor by ffmpeg :confused:
NOTICE: the resulting .AVI files are demuxed correctly by LAV Splitter, Microsoft AVI Splitter, MPlayer and MPV,
but not by the current internal AVI splitter of MPC-BE (1.5.7.6180) :-/
sample file: https://www.mediafire.com/file/zntw0mjv9pi3yrw/0136MF-intro-interview-960x720.avi/file
tebasuna51
10th June 2021, 09:25
I'm not sure if your sample avi have the problematic atrac3p track or the already edited and correct track.
ffmpeg inform of the .avi file:
0: mpeg4 (DX50 / 0x30355844), yuv420p, 960x720 [SAR 1:1 DAR 4:3], 4302 kb/s, 29 .97 fps, ...
1: atrac3p, 44100 Hz, stereo, fltp, 192 kb/s
I used VirtualDub2 to Save audio... like wav, and I obtained a correct wav like this:
File ........: C:\tmp\0136MF-intro-interview-960x720.wav
Size ........: 75916208 bytes
---------------------------------------------- Header Info
ChunkID .....: RIFF
RiffLength ..: 75916200
Container ...: WAVE
SubchunkID ..: fmt (Length: 40)
AudioFormat .: 65534 (WAVE_FORMAT_EXTENSIBLE)
NumChannels .: 2
SampleRate ..: 44100
ByteRate ....: 352800
BlockAlign ..: 8
BitsPerSample: 32
ValidBitsPS .: 32
MaskChannels : 3 (FL FR)
SubType .....: 3 (Float)
SubchunkID ..: JUNK (Length: 52)
SubchunkID ..: data (Length: 75916080)
Offset data .: 128
Duration ....: 215.18163 sec., (0h. 3m. 35.18163s.)
------------------------------------------------- End Info
Have a extra chunk 'JUNK' (filled with '0'), but must be ignored for any correct soft, and the rest of data is all OK.
The .wav play without problems in mpc-hc, vlc, foobar2000, Audacity and GoldWave
Can you upload the problematic track?
GMJCZP
10th June 2021, 11:59
tebasuna, With what program do you get the information of the audio track?
tebasuna51
10th June 2021, 12:25
My LeeAudBi (https://forum.doom9.org/showthread.php?p=1522330#post1522330)
GMJCZP
10th June 2021, 13:16
Thanks, I can't downloading it, says in Sendspace "Failed to fetch data, please retry". By the way, is it 64 bit only?
filler56789
10th June 2021, 15:47
I'm not sure if your sample avi have the problematic atrac3p track or the already edited and correct track.
This .AVI has the "fixed" one.
To make things clearer: the atrac3+ stream itself was not modified at all,
what I had to change is its .WAV header
— otherwise VirtualDub would generate an unplayable .AVI file :-/
Whereas both AVI-Mux GUI and ffmpeg always fail at muxing,
regardless of how correct is the .WAV header of the .at3+ track.
Can you upload the problematic track?
I'll send you a private message, because that's not exactly the point.
filler56789
10th June 2021, 18:05
Can you upload the problematic track?
Hopefully this image will be more useful than another "sample file"...
for the time being, at least.
https://forum.videohelp.com/attachments/59394-1623344290/atrac3plus-WAV-untouched.png
tebasuna51
11th June 2021, 00:31
Thanks, I can't downloading it, says in Sendspace "Failed to fetch data, please retry". By the way, is it 64 bit only?
This is a 32 bit version in Mediafire: https://www.mediafire.com/file/qllhql0a34zf28x/LeeAudBi6_32.7z/file
tebasuna51
11th June 2021, 01:06
This .AVI has the "fixed" one.
To make things clearer: the atrac3+ stream itself was not modified at all,
what I had to change is its .WAV header...
Ok, thanks, I understand. The wav I checked before was the decoded atrac2p (the modified) by VirtualDub2
The created by the at3tool is:
File ........: C:\tmp\Test\at3\file2.wav
Size ........: 3448536 bytes
---------------------------------------------- Header Info
ChunkID .....: RIFF
RiffLength ..: 3448528
Container ...: WAVE
SubchunkID ..: fmt (Length: 52)
AudioFormat .: 65534 (WAVE_FORMAT_EXTENSIBLE)
NumChannels .: 2
SampleRate ..: 44100
ByteRate ....: 16021
BlockAlign ..: 744
BitsPerSample: 0 (WARNING: must be 8 multiple to verify BlockAlign)
ValidBitsPS .: 2048
MaskChannels : 3 (FL FR)
SubType .....: 43711 (Search in MMREG.H)
SubchunkID ..: fact (Length: 8)
SampleLength : 9489510 (fact Duration: 215.18163 sec.)
SubchunkID ..: data (Length: 3448440)
Offset data .: 96
Duration ....: 215.24499 sec., (0h. 3m. 35.24499s.)
------------------------------------------------- End Info
And have the big 'fact' chunk (Length: 8, when must be 4)
00000000 52 49 46 46 D0 9E 34 00 57 41 56 45 66 6D 74 20 34 00 00 00 FE FF 02 00 RIFFÐz4.WAVEfmt 4...þÿ..
00000018 44 AC 00 00 95 3E 00 00 E8 02 00 00 22 00 00 08 03 00 00 00 BF AA 23 E9 D¬..>..è...".......¿ª#é
00000030 58 CB 71 44 A1 19 FF FA 01 E4 CE 62 01 00 28 5C 00 00 00 00 00 00 00 00 XËqD¡.ÿú.äÎb..(\........
00000048 66 61 63 74 08 00 00 00 66 CC 90 00 00 08 00 00 64 61 74 61 78 9E 34 00 fact....fÌ_.....dataxz4.
The 08, in this 44100 Hz sample, must be changed to 4, and the 00 08 00 00 bytes deleted.
But maybe the RiffLength ..: 3448528 D0 9E 34 00 must also to be modified to 3448524 -> CC 9E 34 00
GMJCZP
11th June 2021, 03:17
This is a 32 bit version in Mediafire: https://www.mediafire.com/file/qllhql0a34zf28x/LeeAudBi6_32.7z/file
Thanks tebasuna, I suggest that both versions are available on the same server, and that if possible they can be found by your signature, added to BeHappy.
filler56789
11th June 2021, 03:51
But maybe the RiffLength ..: 3448528 D0 9E 34 00 must also to be modified to 3448524 -> CC 9E 34 00
You are correct. :o
filler56789
13th June 2021, 22:31
Thanks tebasuna, I suggest that both versions are available on the same server, and that if possible they can be found by your signature, added to BeHappy.
But while he doesn't do that... :)
LeeAudBi6, both 32-bit and 64-bit .EXEs + source-code.
https://www.mediafire.com/file/92jhvi6r2i2rgzl/LeeAudBi6.rar/file
GMJCZP
14th June 2021, 00:14
But while he doesn't do that... :)
LeeAudBi6, both 32-bit and 64-bit .EXEs + source-code.
https://www.mediafire.com/file/92jhvi6r2i2rgzl/LeeAudBi6.rar/file
Thank you very much.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.