'drinking.wav' has errors, skipped

About PR usage and development, and about the POP format.
Post Reply
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

'drinking.wav' has errors, skipped

Post 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
Attachments
drinking.zip
(7.07 KiB) Downloaded 113 times
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: 'drinking.wav' has errors, skipped

Post 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.
Attachments
drinking.zip
(7.02 KiB) Downloaded 118 times
realXCV
Beylerbey
Beylerbey
Posts: 72
Joined: November 4th, 2011, 12:04 am
Location: Right here
Contact:

Re: 'drinking.wav' has errors, skipped

Post by realXCV »

The difference is that there's a 'LIST' chunk in the first file between the 'fmt ' chunk and the 'data' chunk.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: 'drinking.wav' has errors, skipped

Post 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
Attachments
riffmci.pdf
(394.55 KiB) Downloaded 106 times
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: 'drinking.wav' has errors, skipped

Post by David »

PR is quite strict about the format the WAV header. I guess it should be more permissive...
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: 'drinking.wav' has errors, skipped

Post 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.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1785
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: 'drinking.wav' has errors, skipped

Post 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 92 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.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: 'drinking.wav' has errors, skipped

Post 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.)
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1785
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: 'drinking.wav' has errors, skipped

Post 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 102 times

WAV file which didn't process:

audio2.zip
(53.48 KiB) Downloaded 110 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.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: 'drinking.wav' has errors, skipped

Post 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?
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: 'drinking.wav' has errors, skipped

Post 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.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1785
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: 'drinking.wav' has errors, skipped

Post 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.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: 'drinking.wav' has errors, skipped

Post 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.
Post Reply