Page 1 of 1

Someone know a sound software to edit PoP sound?

Posted: August 3rd, 2009, 4:23 pm
by OrSpeeder
Plainly that: Poirot used a totally really old RIFF header format...

Now I tested already 6 software, all them failing to save natively in the format that PR saves, and all them failing to save natively in PR format after I use "sox" on them...

The results vary, but usually it is just random noise... I tried saving even with "windows recorder" on my XP, and it also saves with the new RIFF PCM header (that has a "FACT tag inside, that PR does not support... and even tough sox remove the FACT tag, the file remain non-working).

So, someone here that ever edited PoP sounds can point me what software on earth can I use?

Re: Someone know a sound software to edit PoP sound?

Posted: August 29th, 2009, 9:25 am
by mickey96
2 years ago I tried to modify POP sound, and I've discovered something I'd like to share with you. There are some header bytes before the sound (Not to mention the Microsoft WAV header), this is the size of the sound.
Oh and for editing POP sounds, I recommend CoolEdit. If you can't find it, ask me for it (the author wants registration).

Re: Someone know a sound software to edit PoP sound?

Posted: September 12th, 2009, 10:12 am
by David
mickey96 wrote:There are some header bytes before the sound
Yes, i've already discovered that.
For PoP1 sounds, the header is:

Code: Select all

1 byte: type of sound, 0=pcspeaker, 1=wave, 2=midi
The following appear only if wave:
	2 bytes: sample rate
	2 bytes: number of samples
	2 bytes: always 0
	1 byte: sample size, always 8
And for PoP2:

Code: Select all

1 byte: type of sound, 0=pcspeaker, 1=wave, 2=midi
The following appear only if wave:
	2 bytes: sample rate
	1 byte: sample size, 8 if not compressed, 255 if compressed (NISDIGI.DAT)
	2 bytes: number of samples, or 0 if compressed
	4 bytes: 0 for most sounds
	The following appears only if compressed:
		2 bytes: number of samples after decompression

Re: Someone know a sound software to edit PoP sound?

Posted: November 21st, 2012, 2:44 am
by Norbert
David wrote:
mickey96 wrote:There are some header bytes before the sound
Yes, i've already discovered that.
For PoP1 sounds, the header is:

Code: Select all

1 byte: type of sound, 0=pcspeaker, 1=wave, 2=midi
The following appear only if wave:
	2 bytes: sample rate
	2 bytes: number of samples
	2 bytes: always 0
	1 byte: sample size, always 8
David, there's something I'm trying to understand. In a related topic here, I tried converting a custom WAV file to the format used by the original game. Theoretically, this should work:

Code: Select all

sox in.wav -e unsigned-integer -r 11025 -c 1 -b 8 out.wav
However, when I use PR to import the file(s) of the DIGISNDx.DAT file that the WAV is a part of, the game doesn't play the sound effect(s). Does this mean that PR exports the WAV files without adding the header, but when importing the WAV files deletes the header data that's already in the DAT file? Because if it doesn't delete the headers and only writes the WAV content back, I would expect the custom WAV to work.

Re: Someone know a sound software to edit PoP sound?

Posted: December 17th, 2012, 1:24 pm
by David
When exporting, PR thinks that in the DAT file, everything after the first byte is part of the sound data, so the header is exported as if it was part of the the sound samples.
When importing, PR still thinks that in the DAT file, everything after the first byte is part of the sound data, so the place of the header is filled with the beginning of the sound samples. If it's a WAV that was exported with PR, then this will write back the header, but otherwise it won't.

Here is the sound in the DAT file: light green=checksum byte, red=sound header, green=samples
sound_dat.PNG
sound_dat.PNG (9.32 KiB) Viewed 5249 times
Here is how PR exports it: orange=part of WAV header, red=sound header (which shouldn't be here!), green=samples
sound_wav.PNG
sound_wav.PNG (10.94 KiB) Viewed 5249 times
Both at exporting and at importing, PR thinks that the "red" is part of the "green".

Re: Someone know a sound software to edit PoP sound?

Posted: December 17th, 2012, 3:11 pm
by Norbert
Thanks for your comprehensive response, David.
I'll have to study it some time to fully understand it.

Re: Someone know a sound software to edit PoP sound?

Posted: August 17th, 2013, 5:52 pm
by jeminacek
Hi everyone!

I created a java program which adds the missing sound header to WAV files so they can be added to POP1 DAT file with PR!

You simply have to create your own WAV in your favourite SW, then convert it with SOX:

Code: Select all

sox in.wav -e unsigned-integer -r 11025 -c 1 -b 8 out.wav
And the next step is to use my little tool:

Code: Select all

java -jar PrinceSound.jar out.wav "touching a wall.wav"
That's it!

Re: Someone know a sound software to edit PoP sound?

Posted: August 17th, 2013, 9:15 pm
by David
Good idea, but it would be better to fix PR.
I have just fixed my copy of PR, and it exports and imports the original sounds correctly, i.e. the red part is not in the wav files.

While at it, some names (in resources.xml) should be replaced with something else, because the current name is either
- meaningless (e.g. 10051: res10051.wav -> door opening in princess's room),
- hard to understand (e.g. 10012: taking a life to the enemy -> sword hits guard),
- or incorrect (e.g. 10007: drinking potion -> gate reached top).
I attached a table that lists some information about all PoP1 sounds, including the name fixes.

Re: Someone know a sound software to edit PoP sound?

Posted: August 17th, 2013, 11:55 pm
by Norbert
Until PR is fixed, this software will be quite useful. :)
I'll definitely add some custom sounds to my next mod.