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.
WriteLong((len1-8)) ; size of file -8 bytes for header
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 WriteWord(chan) Debug("Channels "+Str(chan)) samrate=smplist()\deffreq ; Sample rate WriteLong(samrate) Debug("Rate "+Str(samrate)) BlockAlign=smplist()\_bits/8*chan ;2 Block align Debug("BlockAlign "+Str(BlockAlign)) AvgBytesPerSec = samrate * BlockAlign ;4 Average bytes per second WriteLong(AvgBytesPerSec) Debug("AvgBytesPerSec "+Str(AvgBytesPerSec)) WriteWord(BlockAlign) WriteWord(smplist()\_bits) ;2 Significant bits per sample Debug("Bits "+Str(smplist()\_bits)) ;WriteWord(0) ;2 Extra format bytes WriteString("data") WriteLong(len1) WriteData(ptr1,len1) CloseFile(0) Debug(FSOUND_Sample_Unlock(smplist()\ptr,@ptr1,@ptr2,len1,len2))
- Inner asked 13 years ago
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 ?
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 ? 😆
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.
Please login first to submit.