Qhimm.com Forums

Final Fantasy 7 => FF7 Tools => Topic started by: luksy on 2012-01-20 14:28:30

Title: [PC] Sound Effects dumper/encoder - sfxEdit (0.3)
Post by: luksy on 2012-01-20 14:28:30
Fiddling about with cosmo to change some of the new sound effects was a little tedious after a while, so I made this to dump and process an entire folder into audio.fmt + audio.dat

Check the readme for details, the looping details are a guess on my part, if anybody has more info I'd be grateful!


sfxEdit (https://www.dropbox.com/s/yy3o7atxyygi7tn/sfxedit_0.3.7z?dl=0)
Title: Re: [WIP] sfxEdit 0.1 --- sound effects dumper / encoder
Post by: DLPB_ on 2012-01-20 15:49:23
Small oversight I think but encode on mine just makes the effects game files 0KB.  :)
Title: Re: [WIP] sfxEdit 0.1 --- sound effects dumper / encoder
Post by: DLPB_ on 2012-01-22 17:11:56
That one has been fixed, but I now get effects in wrong places...  as we discussed this does not seem to happen to everyone.
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: luksy on 2012-01-23 00:54:45
Right I've stopped assuming windows will magically order the files for me, the only possible downside is that it won't accept more than 750 fx in case any need to be added (unlikely, there are loads of empties anyway).
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: LeonhartGR on 2012-02-12 17:43:05
My audio .dat file is 0kb! I can't find it anywhere. I forgot to back it up. When I type e do i need to type the path of the folder where the program recovers the wav files? When I just type e the program exits. The folder needs to have only the wav files? Please help! I can't hear any sounds now
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: DLPB_ on 2012-02-12 18:02:28
You need the original audio.dat file from disc and place in the correct folder. Always back up.
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: LeonhartGR on 2012-02-12 21:29:43
I did but I have the old sounds now. At least I can listen to them...
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: DLPB_ on 2012-04-17 16:32:44
There is nothing wrong with this program, it seems you didn't use it properly.  You have to make sure the files are in the folder it created and then encode once you have swapped them for your own making sure all files exist and correctly named.  You didn't do that which is why there was an issue.
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: LeonhartGR on 2012-04-18 01:34:21
There is nothing wrong with this program, it seems you didn't use it properly.  You have to make sure the files are in the folder it created and then encode once you have swapped them for your own making sure all files exist and correctly named.  You didn't do that which is why there was an issue.

That's an old post. I already solved it... Thanks anyway! :)
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: earth on 2012-08-15 18:32:44
Tried using this with the new FFVII PC re-release. Found an issue.

I placed sfxEdit in the same folder with audio.dat and audio.fmt, and I get error "Fatal error: cannot open registry". I also tried placing sfxEdit separate from this folder, and still the same error. Please fix.

You'll need to release some sort of config file so we can set the path of the folder for the two files, that should fix the issue.
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: DLPB_ on 2012-08-15 18:33:53
Yeah, it can do without the "please fix" message at the end, it comes across as rude.  At least it does to me.  He will fix it when he has the time. He is busy at the moment, so you may be waiting a while.
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: orugari on 2014-02-09 16:06:06
Somehow I changed source for make it works with the re-release... Maybe?
Cause I have no clue about how to compile the source code... I am a web developer... And only that.

getFFPath() would be useless now, the soft may work if you put sfxEdit.exe in the same folder as audio.dat / audio.fmt

So if someone can compile it and give it a try?
http://www.webdellarte.com/update/ff7/sfxEdit.exe.cpp (http://www.webdellarte.com/update/ff7/sfxEdit.exe.cpp)
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: luksy on 2014-02-10 00:34:15
I can have a look at rewriting it, it's not a very big app as I'm sure you noticed. I'll just make it accept a direct path instead of reading the registry, the reg hooks can be called by a batch script instead if necessary.
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: orugari on 2014-02-10 04:35:24
Yeah, I just have no idea how to make it as an exe, but i'd love to do it by myself ^^'
I am using windows, is there a software available to do that? :o
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: Kranmer on 2014-02-10 21:25:49
If you want to compile the source on windows into a EXE, first download Mingw (i recommend "mingw-get-inst-20120426.exe" you can google it)
Install that with options ticked for C, C++, objC, Msys (you can ignore the rest)
Run Mingw Shell from your start menu once. Then close it.
Now go to (by default or change this to where you installed it)
C:\MinGW\msys\1.0\home
and there should be a folder with your windows username, open that folder so you are in
C:\MinGW\msys\1.0\home\Username
now copy all the source files from SfxEdit to that folder (common.h, Makefile, sfxEdit.exe.cpp, sfxEdit.exe.h)
Now open Mingw Shell again from your start menu and type
make
press ENTER
Then it will compile the source into a windows EXE (this works fine with the original source, i recommend trying this with the original source first to make sure it works for you then trying it with your personal edits)
Title: Re: [WIP] sfxEdit 0.2 --- sound effects dumper / encoder
Post by: orugari on 2014-02-10 23:15:30
Oh, Thank you so much !
And here we go, it is working with sfxEdit.exe in the same folder as audio.dat / audio.fmt!
I get the "files" folder with all the wav files :)

Again, thank you luksy for this soft, thank you Kranmer for your explanation!
http://www.webdellarte.com/update/ff7/sfxEdit.exe (http://www.webdellarte.com/update/ff7/sfxEdit.exe)

Edit: the encode method give me an error: incomplete character in file
I don't really have a clue about what is it :(
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: luksy on 2014-02-13 05:23:53
New version here (https://dl.dropboxusercontent.com/u/3227870/sfxedit_0.3.7z), the tool is split into two separate exes for dumping and packing, and all files must be specified on the commandline, i.e.:

sfxdump.exe foo/bar/audio.fmt foo/bar/audio.dat wavdir

Note that the dir (wavdir above) must be created beforehand, because I'm lazy.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: Dr. Zaius on 2014-02-18 08:26:31
Could someone explain this to me in lamens terms. I have no idea what I'm doing and all I want to do is install the "new sound fx" files to my "audio.dat". I tries to use the sfx edit programs but the close as soon as I open them and nothing happens. Someone please just explain to me how to do it, and please keep it simple, I'm new to modding ff7.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: DLPB_ on 2014-02-18 11:54:20
Look at the readme, and then go and look up how to use the command line.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: luksy on 2014-02-18 12:37:12
What he said :D I might make a GUI if I can be bothered.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: Dr. Zaius on 2014-02-18 16:36:17
I'm not trying to be rude, but I already read the readme and it doesn't do a very good job of explaining it so a noob like me can understand. I wouldn't ask if I didn't need the help.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: DLPB_ on 2014-02-18 16:44:55
You need to learn how to use the command line.  There are tons of easy tutorials online.  Without knowing the command line you are always going to be at a disadvantage with certain programs.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: Dr. Zaius on 2014-02-18 17:21:52
OK, I'll have to look into that. For now I'm just going to do the files 1 by 1 using cosmo.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: DLPB_ on 2014-02-18 17:23:36
Unless someone here wants to create you a batch file(anyone?).  Which would do the command line stuff for you.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: luksy on 2014-02-19 03:32:48
Code: [Select]
@echo off
SETLOCAL EnableDelayedExpansion

set key="HKLM\SOFTWARE\Square Soft, Inc.\Final Fantasy VII"
set value=AppPath
set fmt=audio.fmt
set dat=audio.dat
set target=sfx

REG QUERY %key% /v %value% > nul 2>&1

if not ERRORLEVEL 1 for /f "skip=2 tokens=3" %%s in ('REG QUERY %key% /v %value%') do (
set fmt=%%s\data\sound\!fmt!
set dat=%%s\data\sound\!dat!
) else echo Using files in local folder

md %target% > nul 2>&1

choice /c dp /n /m "[d]ump or [p]ack?"

if ERRORLEVEL 2 sfxpack %fmt% %dat% %target%
if ERRORLEVEL 1 sfxdump %fmt% %dat% %target%

Does Steam store the path in the registry as well? I suppose it must store a base path to Steam itself, I can search there too.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: orugari on 2014-02-19 06:07:22

No,I think not.. Or I couldn't find it !
Check what I did. Just put the file in the same folder. And for a GUI version, a folder browser would be cool !  :D

Dr. Zaius
For now, how to use:
Create a folder "soundedit" in your harddrive. C:\soundedit\:
- folder "files"
- audio.dat
- audio.fmt
- sfxEdit.exe
- sfxdump.exe

If you want to extract the sound effect:
1. Start a windows console
2. Drag and drop sfxdump.exe into the console. (magic!)
3. you should have something like: C:\soundedit\sfxdump.exe
4. Add to this line: C:\soundedit\sfxdump.exe C:\soundedit\audio.fmt C:\soundedit\audio.dat C:\soundedit\files

You will get your sound effect into the files folder :)

Do the same to pack back your sounds files.
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: Kompass63 on 2014-02-19 21:10:29
Does Steam store the path in the registry as well? I suppose it must store a base path to Steam itself, I can search there too.

Code: [Select]
...
SET "RegKey_Steam=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 39140"
SET "RegKey_Re=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{141B8BA9-BFFD-4635-AF64-078E31010EC3}_is1"
SET newValue=InstallLocation
...
respectively without "Wow6432Node" on 32 bit OS



EDIT:     I have not tested this!

Code: [Select]
@ECHO off
SETLOCAL EnableDelayedExpansion

IF %PROCESSOR_ARCHITECTURE% == x86 (
SET "RegKey_Steam=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 39140"
SET "RegKey_Re=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{141B8BA9-BFFD-4635-AF64-078E31010EC3}_is1"
SET "RegKey_Old=HKLM\SOFTWARE\Square Soft, Inc.\Final Fantasy VII"
) ELSE (
SET "RegKey_Steam=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 39140"
SET "RegKey_Re=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{141B8BA9-BFFD-4635-AF64-078E31010EC3}_is1"
SET "RegKey_Old=HKLM\SOFTWARE\Wow6432Node\Square Soft, Inc.\Final Fantasy VII"
)


SET fmt=audio.fmt
SET dat=audio.dat
SET target=sfx

REG QUERY "%RegKey_Old%" /v AppPath >NUL 2>&1
IF NOT ERRORLEVEL 1 FOR /F "skip=2 tokens=2*" %%s in ('REG QUERY "%RegKey_Old%" /V AppPath') DO (
SET fmt=%%t\data\sound\!fmt!
SET dat=%%t\data\sound\!dat!
GOTO :continue
)

REG QUERY "%RegKey_Steam%" /v InstallLocation >NUL 2>&1
IF NOT ERRORLEVEL 1 FOR /F "skip=2 tokens=2*" %%s in ('REG QUERY "%RegKey_Steam%" /V InstallLocation') DO (
SET fmt=%%t\data\sound\!fmt!
SET dat=%%t\data\sound\!dat!
GOTO :continue
)

REG QUERY "%RegKey_Re%" /v InstallLocation >NUL 2>&1
IF NOT ERRORLEVEL 1 FOR /F "skip=2 tokens=2*" %%s in ('REG QUERY "%RegKey_Re%" /V InstallLocation') DO (
SET fmt=%%t\data\sound\!fmt!
SET dat=%%t\data\sound\!dat!
GOTO :continue
)

ECHO Using files in local folder
 
:continue
md %target% >nul 2>&1

choice /c dp /n /m "[d]ump or [p]ack?"

if ERRORLEVEL 2 sfxpack "%fmt%" "%dat%" %target% && GOTO :EOF
sfxdump "%fmt%" "%dat%" %target%
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: DLPB_ on 2014-02-20 01:49:36
From Luksy:

Excellent! If you make sure the 32bit version of cmd is running you can avoid the Wow6432Node stuff, doesn't change much in this case. Thanks for the other improvements.

please change "Cmd exe" below to include the .
For some reason this post won't... post when it is there.


Code: [Select]
@echo off
SETLOCAL EnableDelayedExpansion

if %processor_architecture%==AMD64 (
%SystemRoot%\SysWOW64\cmd exe /c %0
goto:eof
)

set "RegKey_Steam=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 39140"
set "RegKey_Re=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{141B8BA9-BFFD-4635-AF64-078E31010EC3}_is1"
set "RegKey_Old=HKLM\SOFTWARE\Square Soft, Inc.\Final Fantasy VII"
set fmt=audio.fmt
set dat=audio.dat
set target=sfx

call:reg_query %RegKey_Old% AppPath
call:reg_query %RegKey_Re% InstallLocation
call:reg_query %RegKey_Steam% InstallLocation

echo Using files in local folder

:run
md %target% > nul 2>&1

choice /c dp /n /m "[d]ump or [p]ack?"

if errorlevel 2 sfxpack "%fmt%" "%dat%" %target% && goto:eof
sfxdump "%fmt%" "%dat%" %target%

goto:eof

:reg_query
REG QUERY %1 /v %2 > nul 2>&1
if not errorlevel 1 for /f "skip=2 tokens=2*" %%s in ('REG QUERY %1 /v %2') do (
set fmt=%%t\data\sound\!fmt!
set dat=%%t\data\sound\!dat!
goto:run
)
Title: Re: sfxEdit 0.3 --- sound effects dumper / encoder
Post by: Kompass63 on 2014-02-20 08:14:46

Code: [Select]
...
if %processor_architecture%==AMD64 (
%SystemRoot%\SysWOW64\cmd exe /c %0
goto:eof
)
....

This trick is great! I'll remember that  8)
Title: Re: [FF7] Sound Effects dumper/encoder - sfxEdit (0.3)
Post by: DLPB_ on 2017-01-19 05:24:05
Please note that this tool does have a big bug at the moment. Sound files are being chopped at the ends (I think only the ends). This is often a few hundred samples and not easily noticeable (until you try looping) - Sometimes it's easily noticeable even without looping, like with effect 45.

Nope.  The bug is Adobe Audition.  :oops:  It is chopping the adpcm files near the end.  How bizarre.  Looks like I'll be needing a new editor.
Title: Re: [FF7] Sound Effects dumper/encoder - sfxEdit (0.3)
Post by: stavstav on 2017-04-09 04:10:06
404
please re-upload, thanks
Title: Re: [FF7] Sound Effects dumper/encoder - sfxEdit (0.3)
Post by: luksy on 2017-04-09 15:31:24
Updated link in first post.
Title: Re: [FF7] Sound Effects dumper/encoder - sfxEdit (0.3)
Post by: stavstav on 2017-04-10 00:00:45
Thanks.  Ended up using FF8Audio (java program) which worked great, but still nice to have this tool =)