I integrated the pcmenc replayer in my C library.
Everything works fine, but I just didn't understand the length
parameter.
The source code says "Sample length (#pcm samples)
", but I don't know how to interpret it.
I thought it was the size of the data since I use a 8-bit PCM, but if I set the size as length, I have the sound that plays normally but after I have a glitch noise. If I put half the size of the data, the sound seems to cuts at the right place.
Is this the right value?
PS: Bravo for this great work!
@aoineko
Where do you find the parameter length ? Input parameters are (from the source pcmenc.cpp):
printf("pcmenc.exe [-r] [-e ] [-cpuf ] [-p ]\n"); printf(" [-dt1 ] [-dt2 ] [-dt3 ]\n"); printf(" [-a ] [-rto ] \n");
I was speaking about the assembler replayer.
;------------------------------------- ; Plays one sample ; IN HL - Encoded sample start address ; DE - Sample length (#pcm samples) ;-------------------------------------
That parameter is the number of pcm samples to be executed. The RLE data do not include a terminator, so the player has to know in advance how many samples have to be executes.
For a 8-bits source wave file I though that the number of "samples" was equal to the size of the data in bytes. But the right value for replayer seem to be half the size of the data.
Oh, perhaps it is the "size of data" / "number of channel in use"?
IIRC it should be the number of PCM samples. You should consider just the payload in the wav file.
Moreover the encoder can accept both 16 bit and 8 bit data (not float). The fact you find that the number of samples is about half the size of the wav file in bytes could be due to the fact you have samples as 16 bit data
However, the file seems to be in 8-bit... ¯\_(ツ)_/¯
I see... Could you send me one of the wav files you are are testing ? I can try to resurrect my files and test it
You can use ragozini at google's email domain
Hi ARTRAG, yesterdey I was messing around with pcmenc (I want to add on Turrican the digitized voice sample at the beginning) but I've encountered some problems: the encoder supports only 8K mapper (I use ASCII16) and the player can't be assembled with Glass (after removing the macros I've obtained an "out of range" error).
And starting from an 8bit 67KB PCM file I had a 128KB bin file (but this I suppose is due to the 8KB chunks encoding)
Send me an email, my address is my surname at google's email domain