HearthSim / UnityPack

Python deserialization library for Unity3D Asset format
https://hearthsim.info/
MIT License
720 stars 153 forks source link

Can't extract ogg files with unityextract #83

Open Lykrast opened 5 years ago

Lykrast commented 5 years ago

Extracting ogg files with unityextract from unity3d files keeps giving me this error:

Traceback (most recent call last):
  File "unityextract", line 159, in <module>
    main()
  File "unityextract", line 155, in main
    exit(app.run())
  File "unityextract", line 57, in run
    self.handle_asset(asset)
  File "unityextract", line 97, in handle_asset
    samples = extract_audioclip_samples(d)
  File "C:\Users\Lykrast\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack\utils.py", line 37, in extract_audioclip_samples
    sample = af.rebuild_sample(sample)
  File "C:\Users\Lykrast\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fsb5\__init__.py", line 212, in rebuild_sample
    from . import vorbis
  File "C:\Users\Lykrast\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fsb5\vorbis.py", line 12, in <module>
    vorbis = load_lib('vorbis')
  File "C:\Users\Lykrast\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fsb5\utils.py", line 76, in load_lib
    raise LibraryNotFoundException('Could not load the library %r' % (names[0]))
fsb5.utils.LibraryNotFoundException: Could not load the library 'vorbis'

I have put the libogg and libvorbis provided by fsb5 on the following places and so far none of them worked or changed the error:

GergoLadi commented 5 years ago

I was facing the same issue. I figured I'd see if it works on Windows 7, so I fired up a VM. As soon as I set everything up and started the script, I got a message box telling me that MSVCRT120.dll was missing from the system. So I went ahead and downloaded and installed the Visual C++ Redistributable Packages for Visual Studio 2013 pack that contains said DLL, and sure enough, it worked! Then I went back to my Windows 10, installed the redistributables there as well, success. So if you get this error despite having libvorbis.dll in the right place, chances are you're also missing this pack. Just make sure you get the right version for your Python -- if you have the 32-bit version (which seems to be the case for you), get the 32-bit version of the redistributables, even if your operating system itself is 64-bit.

sebastientromp commented 5 years ago

This didn't work for me. I've copied the dll mentioned here to more or less the same places as Lykrast above, but the script still can't find them.
I've also installed the Visual C++ Redistributable linked above.

$ ./bin/unityextract --audio -o out/audio2 /d/Games/Hearthstone/Data/Win/{rad_base,rad_enus,actors,cards,cardxml,dbf,expansionmusic,heromusic,gameobjects,legendary,missionsound,otherminionsound,playsound,premiummaterial,scriptableobject,shared,sounds,spell}*.unity3d
Traceback (most recent call last):
  File "./bin/unityextract", line 159, in <module>
    main()
  File "./bin/unityextract", line 155, in main
    exit(app.run())
  File "./bin/unityextract", line 57, in run
    self.handle_asset(asset)
  File "./bin/unityextract", line 97, in handle_asset
    samples = extract_audioclip_samples(d)
  File "C:\Users\Daedin\AppData\Local\Programs\Python\Python37\lib\site-packages\unitypack\utils.py", line 37, in extract_audioclip_samples
    sample = af.rebuild_sample(sample)
  File "C:\Users\Daedin\AppData\Local\Programs\Python\Python37\lib\site-packages\fsb5\__init__.py", line 212, in rebuild_sample
    from . import vorbis
  File "C:\Users\Daedin\AppData\Local\Programs\Python\Python37\lib\site-packages\fsb5\vorbis.py", line 12, in <module>
    vorbis = load_lib('vorbis')
  File "C:\Users\Daedin\AppData\Local\Programs\Python\Python37\lib\site-packages\fsb5\utils.py", line 76, in load_lib
    raise LibraryNotFoundException('Could not load the library %r' % (names[0]))
fsb5.utils.LibraryNotFoundException: Could not load the library 'vorbis'

Still looking, I'll post something here if I ever get it to work :)

sebastientromp commented 5 years ago

Using ProcessMonitor I found out where the script was looking for the libs:

image

Please also note that it's looking for vorbis.dll, and not libvorbis. So copying the libvorbis.dll to my user's bin folder and renaming it to vorbis.dll seemed to work