Unable to import audio files into DAT

About PR usage and development, and about the POP format.
Post Reply
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Unable to import audio files into DAT

Post by VelCheran »

Hi there,

I'm trying to use PR to change the game's music and sound effects, but right now I'm stuck at the import phase.
I extracted the sound files from the game, replaced the original "main theme.mid" by another midi file, and when I try to import I get this:

Princed resources (PR) v1.3.1 Win32
(c) Copyright 2003-2012 Princed Development Team
http://www.princed.org

Importing 'midisnd2.DAT' from '..\..\resources\midisnd2'
'story2 princess waiting.mid' has errors, skipped
Result: File not found (-6)
'story4 Jaffar leaves.mid' has errors, skipped
Result: File not found (-6)
'story3 Jaffar comes.mid' has errors, skipped
Result: File not found (-6)
'main theme.mid' has errors, skipped
Result: File not found (-6)
'story1 In the absence.mid' has errors, skipped
Result: File not found (-6)
'winning theme.mid' has errors, skipped
Result: File not found (-6)
Importing done, 0 files imported ok, 0 files with error
Result: Success (0)

It's not really self-explanatory, so I don't know what to do. What puzzles me is that files I didn't touch have errors (I mean if it was only for "main theme.mid" I would be less surprised).
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Unable to import audio files into DAT

Post by David »

VelCheran wrote: October 30th, 2022, 1:27 pm It's not really self-explanatory, so I don't know what to do. What puzzles me is that files I didn't touch have errors (I mean if it was only for "main theme.mid" I would be less surprised).
For each MIDI it says "Result: File not found (-6)".

Did you pass the correct path in the command line?
Are the MIDI files really in '..\..\resources\midisnd2' relative to where you run PR?
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: Unable to import audio files into DAT

Post by VelCheran »

Yes they are. I tried locating the folder "midisnd2" inside the same as pr, I got the same thing.
And it worked by putting the files in the same folder and use directly -i instead of --import=PATH and this time it worked. So it looks like --import doesn't work.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Unable to import audio files into DAT

Post by David »

VelCheran wrote: October 31st, 2022, 4:13 pm Yes they are. I tried locating the folder "midisnd2" inside the same as pr, I got the same thing.
And it worked by putting the files in the same folder and use directly -i instead of --import=PATH and this time it worked. So it looks like --import doesn't work.
I think I figured out the problem:
The path after --import should be the path to the folder which contains midisnd2, not the path to the midisnd2 folder itself.

For example, instead of --import=..\..\resources\midisnd2 you need --import=..\..\resources .
PR will automatically append the \midisnd2\ part if you import into midisnd2.dat .

The error message could indeed be better.
Right now it only tells the path given to --import and the file name, but it's missing the extra path component between the two.
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: Unable to import audio files into DAT

Post by VelCheran »

Oh ok, thanks, I wouldn't have guessed it by myself :D
Post Reply