been all over the net but I can’t find a single reference of code/doc that tells me how to give this infomation to the .wav header.

of course I am asuming here that it is a flag or something ๐Ÿ˜ณ ๐Ÿ˜ฎ sorry just love those smiles. :) ๐Ÿ˜†

Here is the bit of code I am working with at the moment, don’t worry if your replys are in C I can read those. :) thanks.

Debug("Ptr1 "+Str(ptr1))
Debug("Ptr2 "+Str(ptr2))
Debug("Len1 "+Str(len1))
Debug("Len2 "+Str(len2))
WriteLong((len1-8)) ; size of file -8 bytes for header
WriteString("fmt ")
WriteLong(16) ; size of fmt chunk, 16 bytes

            ;   For PCM based samples, data must be signed 8 or 16bit. 
            ;   For compressed samples such as those created with FSOUND_XADPCM,
            ;   FSOUND_VAG, FSOUND_GCADPCM, the data must be in its original compressed format.

            WriteWord(1)                                ; Compression code (Microsoft ADPCM)
            chan=smplist()\_channels                    ; Number of channels
            Debug("Channels "+Str(chan))
            samrate=smplist()\deffreq                   ; Sample rate
            Debug("Rate "+Str(samrate))

            BlockAlign=smplist()\_bits/8*chan           ;2 Block align
            Debug("BlockAlign "+Str(BlockAlign))
            AvgBytesPerSec = samrate * BlockAlign       ;4 Average bytes per second
            Debug("AvgBytesPerSec "+Str(AvgBytesPerSec))

            WriteWord(smplist()\_bits)                  ;2 Significant bits per sample
            Debug("Bits "+Str(smplist()\_bits))

            ;WriteWord(0)                               ;2 Extra format bytes




  • You must to post comments


When the compression code is 1 for ADPCM the data HAS TO BE signed, you don’t have to tell it again in the header.
You cannot make it unsigned with this compression code – no other program than yours could read your data then.

Here’s my favourite WAV-page :

Or did I misunderstood you ?

  • You must to post comments

Yes indeed the comment is wrong :)

-however- the output data, probably should have posted this before hand is this; I’m testing my sample out with ModPlug Tracker / Skale Tracker.

1000 ; Compression

0000 ;(1000) Number of channels ( this should be 1, but MPT says this is an unknown file format. (1=Mono) I asume.

44AC0000 ; Sample rate
44AC0000 ; Average bytes per second
0100 ; Block align
0800 ; Significant bits per sample

This is how my data looks, I’m guessing this is because MPT or another application is thinking that the data is unsigned.

This is how it is supposed to look.

Here’s my favourite WAV-page :

Have just discover that 16-Bit samples save perfectly fine, it’s just the 8-Bit samples I am having trouble with, [and later still discovers the following] if I save the 8-bit sample data as a 16 bit it works too, is this even proper ? ๐Ÿ˜† :roll:

And of course I am asuming that this data is going to stay constant on me, that it won’t matter if the mod uses an IFF/Voc/XI or Wav, I hope so or I am really in trouble, because that digs to the way over my head area.

Another thing I thought of was converting the data from signed to unsigned, is this really nessary or am I clutching at straws looking for another way around.

Hehee found that in searching the forum, that is how I got this far actually, and quite likely dug myself this hole.

  • You must to post comments

aha! worked… thank you lots ๐Ÿ˜€ :) ๐Ÿ˜‰

Now to add all the rest of the infomation :)

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.