nesa24, well done. It's nice to see programmers around the forum. You should be releasing the source code of your tools, maybe someone could help you directly. Since you're using .NET, I was able to take a look at what you're doing through your decompiled source code, and from the information you've given, I was able to replace the first seconds of Mercy with the first seconds of any song on my computer, just like you did. Now if you can figure out how the different chunks are placed inside the .bin file, you could be making a song import/export tool in no time. I don't understand if you've already figured that out from your posts, but I hope you have.
To everyone else...
Like nesa24 said, the files are in WMAv2,
32kbps, Stereo, 44.1 KHz, 16bit. To get any song on your PC to that format, you use xWMAEncode. xWMAEncode is part of Microsoft's DirectX SDK, and can be found here:
http://www.mediafire.com/download/zccl8 ... Encode.exe. You run it by putting it anywhere and running it through the command line like this:
- Code: Select all
xWMAEncode -b 32000 mysong.wav mysong.xma
You can also decode xWMA files like so:
- Code: Select all
xWMAEncode mysong.xma mysong.wav
Once you encode a file to xWMA, open it in any hex-editor, and find the "data" header. After the ASCII codes for "data" is the size of the rest of the file in 4 bytes, and then the actual song data. So, what nesa24 has done so far is grab a chunk of that song data and throw it right into jukeboxmusic.bin at decimal offset 96 to replace the start of Mercy.
Problem is, we need to figure out the size of those chunks (is it 4K? 8K? Something else?) and their offsets inside the .bin files. Once we do, we can replace the songs. As for the chunk size, I'd say 8192 bytes (8KB) is a candidate, since that number is what's inside bytes 92-95 in jukeboxmusic.bin. Could be wrong though.