Page 1 of 1

'drinking.wav' has errors, skipped

Posted: September 22nd, 2019, 6:15 pm
by Norbert
David, any idea why the attached WAV is not accepted by PR...?
I made it the exact same format as the original.
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 11000 Hz

Re: 'drinking.wav' has errors, skipped

Posted: September 23rd, 2019, 12:02 pm
by Norbert
Here's a version that works.
I don't know what the difference is.
I created the version that works by running the one that does not work through SoX.

Re: 'drinking.wav' has errors, skipped

Posted: September 24th, 2019, 2:18 am
by realXCV
The difference is that there's a 'LIST' chunk in the first file between the 'fmt ' chunk and the 'data' chunk.

Re: 'drinking.wav' has errors, skipped

Posted: September 24th, 2019, 11:18 am
by Norbert
realXCV wrote: September 24th, 2019, 2:18 am The difference is that there's a 'LIST' chunk in the first file between the 'fmt ' chunk and the 'data' chunk.
Ah, I did manage to find it now.

So, there is an optional
- "LIST"
followed by
- a doubleword stored in little endian ('reverse') byte order that specifies the size of that chunk ("1A 00 00 00" in this case)
followed by
- the chunk bytes (26 in this case)

https://en.wikipedia.org/wiki/WAV#RIFF_WAVE

Re: 'drinking.wav' has errors, skipped

Posted: September 28th, 2019, 1:03 pm
by David
PR is quite strict about the format the WAV header. I guess it should be more permissive...

Re: 'drinking.wav' has errors, skipped

Posted: September 29th, 2019, 10:21 am
by David
David wrote: September 28th, 2019, 1:03 pm PR is quite strict about the format the WAV header. I guess it should be more permissive...
Here is my fix on a new branch: https://github.com/NagyD/PR/commit/49bf ... e05d152033

Please test it, and if you too think that it works correctly then I will merge the branch.

Re: 'drinking.wav' has errors, skipped

Posted: June 13th, 2020, 6:46 pm
by atrueprincefanfrom18
I just got this video into my YouTube's recommendation and I tried to replace some audios. I could extract 4 audios as attached in the ZIP file, but only one could go through. I don't know why but except "guard death, get sword.mid" all others are failing to import in DAT format.

Video:





ZIP:

test-wav.zip
(710.98 KiB) Downloaded 332 times

I converted "guard death, get sword.wav" to "guard death, get sword.mid" from some online tool... Maybe you can look at that file as well. It would be great if we could get the audios from that video, as there are lot of interesting sounds in it.

David, can you please help?

Edit: I found this after posting the post! But I think we all should work for getting these amazing audios into DAT files. I'm kinda bored with original audio ;)

++Edit: I will try to get the level end music and door closing sound from this video tomorrow.

Re: 'drinking.wav' has errors, skipped

Posted: June 13th, 2020, 7:23 pm
by David
atrueprincefanfrom18 wrote: June 13th, 2020, 6:46 pm I could extract 4 audios as attached in the ZIP file, but only one could go through. I don't know why but except "guard death, get sword.mid" all others are failing to import in DAT format.
There are two things in your WAV files that PR doesn't like:

1. There is a "LIST" chunk between the "fmt " and the "data" chunk. Just like in the WAV in the first post.
The latest release of PR can't handle that yet, but there is an untested fix here.

2. Theses WAVs use 16 bits per sample, but PR can only handle WAV files with 8 bits per sample.
You should convert it to 8 bits per sample using an audio converter. (That might remove the LIST chunk as well.)

Re: 'drinking.wav' has errors, skipped

Posted: June 13th, 2020, 7:59 pm
by atrueprincefanfrom18
atrueprincefanfrom18 wrote: June 13th, 2020, 6:46 pm ++Edit: I will try to get the level end music and door closing sound from this video tomorrow.
Got some free time today itself. Again, could only do "story5 Marry Jaffar, end level.mid" audio. I think there's just no problem for PR for handling .mid files and "level door closing.wav" failed.

Attached MIDISND1.DAT. Modified "guard death, get sword.mid" and "story5 Marry Jaffar, end level.mid". You can try those out although I think they need more editing with enhanced effects. Anyone willing to help and can help, please join! :)

MIDISND1.DAT
(9.75 KiB) Downloaded 333 times

WAV file which didn't process:

audio2.zip
(53.48 KiB) Downloaded 345 times
David wrote: June 13th, 2020, 7:23 pm You should convert it to 8 bits per sample using an audio converter. (That might remove the LIST chunk as well.)
Can you recommend any tool to do this please? I am using ffmpeg and online tool if I cannot find any command for ffmpeg to do what I want to do. If you can suggest any tool who can do this, that would be great.

Re: 'drinking.wav' has errors, skipped

Posted: June 13th, 2020, 8:27 pm
by Norbert
atrueprincefanfrom18 wrote: June 13th, 2020, 7:59 pmCan you recommend any tool to do this please?
For audio conversion, my non-gui go-to tool (on Linux) is sox.
The audacity gui tool is useful too, but, in my experience, less suitable for audio manipulation.
Related post here: viewtopic.php?p=11875#p11875
But, yeah, perhaps it's time for the PR version that includes the fix to be released officially?

Re: 'drinking.wav' has errors, skipped

Posted: June 14th, 2020, 6:55 pm
by David
atrueprincefanfrom18 wrote: June 13th, 2020, 7:59 pm
David wrote: June 13th, 2020, 7:23 pm You should convert it to 8 bits per sample using an audio converter. (That might remove the LIST chunk as well.)
Can you recommend any tool to do this please? I am using ffmpeg and online tool if I cannot find any command for ffmpeg to do what I want to do. If you can suggest any tool who can do this, that would be great.
With ffmpeg, use this command:
ffmpeg -i old.wav -acodec pcm_u8 new.wav

(I found the codec name in the output of "ffmpeg -formats".)

By the way, ffmpeg (at least the version I'm using) works correctly even if the output file is the same as the input file.
I didn't know that before.

Norbert wrote: June 13th, 2020, 8:27 pm But, yeah, perhaps it's time for the PR version that includes the fix to be released officially?
Yes, however, I'd like if someone other than me tested it as well.

Re: 'drinking.wav' has errors, skipped

Posted: September 7th, 2020, 12:36 pm
by atrueprincefanfrom18
I got this video and it's nice to hear that dying sound instead of the default one, watch the last bit:





I think the community hasn't got a lot ahead trying to alter the modify, everyone is just focusing on graphics. I'm now trying to extract that audio when the Kid is spiked.

Re: 'drinking.wav' has errors, skipped

Posted: September 7th, 2020, 6:30 pm
by Norbert
atrueprincefanfrom18 wrote: September 7th, 2020, 12:36 pm[...music], everyone is just focusing on graphics.
This is mostly true, in that few modders try to modify audio.
Personally, for several mods I did put work into this.
Particularly Micro Palace and Neon Persia.
My go-to site for sound effects is generally Freesound.org.
It's fun to test new sounds in the game.
Also reminds me of this video.