Jump to content
Guest Sam.

WAV to WAVC conversion

Recommended Posts

Guest Sam.

In the WAV to WAVC conversion, DLTCEP writes (0x1c000000010010002256fd9f) in the file at the offset 0x0010 instead of the "constant value" IESDP says to use (0x1c000000010010002256e777)

 

In the 9634 .WAVC files found in my Classic Adventures game, I found these variations:

 

1c0000000100100022560000 (706 times)

1c0000000100100022569c77 (1844 times)

1c000000010010002256e777 (5251 times)

1c000000010010002256ed77 (14 times)

1c000000010010002256fd7f (621 times)

1c000000010010002256fd9f (110 times)

1c0000000200100022560000 (182 times)

1c0000000200100022569c77 (34 times)

1c000000020010002256e777 (716 times)

1c000000020010002256ed77 (2 times)

1c000000020010002256fd7f (96 times)

1c0000000200100044acfd9f (58 times)

 

Is it really a static value after all, and why does DLTCEP use the value it does (not IESDP)?

 

TIA,

Sam.

Share this post


Link to post
Guest Sam.

In fact I can tell it's not supposed to be static at all....

 

1c000000010010002256e777

Looks like the first byte (1c) is the offset to the end of the WAVC header.

The 5th byte (01) is the number of channels.

The 7th byte (10) is the bits per sample.

 

What do the other bytes do?

 

TIA,

Sam.

Share this post


Link to post
What do the other bytes do?
I guess they are unknowns for now, unless Avenger or someone else knows...

Share this post


Link to post
Guest Sam.

I found that after discovering almost all the same information on my own, but it isn't complete. Specifically, the bytes of data at 0x1A and 0x1B between the Sampling Rate (in Hz) and the ACM Header. DLTCEP's WAV to WAVC conversion, though, apparently puts the appropriate value there, but I don't understand what it is or where it comes from. (See the last 4 characters in each of the header variations in the first post.)

 

Also, does the uncompressed size really need to be the size as if the wave file is full uncompressed even if that is not what was put into the WAV to ACM conversion? If this is the case then how do I determine what the fully uncompressed size is? And is the "uncompressed size" really the size of the ENTIRE file or is it really the size of the data itself (whole file minus the header)?

 

TIA,

Sam.

Share this post


Link to post

Alright, I found where the uncompressed size comes form. Now the only two things that I don't know what they do or where they come form are:

1) The bytes of data in the WAVC file referred to at wiki.multimedia as "Unknown" at 0x1A and 0x1B between the Sampling Rate (in Hz) and the ACM Header, and

2) The bytes of data in the ACM file (and subsequently in the WAVC file) referred to as "Levels" at offsets 0x28 and 0x29 which ALWAYS seems to be either 0701 or 0801.

 

What are these two things?

 

TIA,

Sam.

Share this post


Link to post

Try to put your hands on acmlab, or if that is not available, just download dltcep's source.

In there, you will find snd2acm.cpp

 

This code defines the acm header as this:

		long signature;
	long samples;
	unsigned short channels;
	unsigned short rate;
	unsigned short levels : 4;
	unsigned short subblocks : 12;

 

As you see the last word contains two fields, one with 4 bits the other with 12 bits.

The code itself calculates these, but i have no idea how it is done.

 

I initialize the wavc headr struct with this code:

WAVC_HEADER wavc={
 {'W','A','V','C'},
 {'V','1','.','0'},
 0,0,28,
 2,16,22050,0x9ffdu
};

So, if it contains the right value, it is because it is a constant. (I guess you talk about the 0x9ffd value).

If it is unknown, then i never change it after the initial assignment.

Share this post


Link to post
Try to put your hands on acmlab
As far as I can tell, there is no such program as "acmlab" (at least in relation to the Infinity Engine). The only reference to "acmlab" that I can find anywhere in the ether (and even then only very sparingly) is an INTERNAL product name of BOTH snd2acm.exe AND compare.exe (both of which I have already incorporated into my GUI). I suppose the snd2acm converter is what you are talking about?

 

I initialize the wavc headr struct with this code:

WAVC_HEADER wavc={
 {'W','A','V','C'},
 {'V','1','.','0'},
 0,0,28,
 2,16,22050,0x9ffdu
};

So, if it contains the right value, it is because it is a constant. (I guess you talk about the 0x9ffd value).

If it is unknown, then i never change it after the initial assignment.

The WAVC signature and version (WAVCV1.0) are the only values that should be static. I suspect that the offset to the end of the WAVC header doesn't necessarily have to be 28 bytes, although it is in every WAVC file in my game, so it might as well be static. The compressed and uncompressed sizes are obviously dynamic. They can be either mono or stereo, and the sampling rate is usually either 22050 Hz or 44100 Hz. All of the WAVC files seem to be 16-bit, but can probably also be 8-bit. The "Unknown" value is also dynamic. I have documentation backing this up, but I CAN'T ADD ATTACHMENTS TO THE POST!!!

Share this post


Link to post

Well, in all files produced by dltcep the unknown value is the constant from the above struct.

 

And it seems acmlab is no longer available on the net. I meant the original source code of the snd2acm utility.

You can still get it from the dltcep source.

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...