Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: 16 is not a valid SoundFormat #21

Open
PiSaucer opened this issue May 3, 2023 · 1 comment
Open

ValueError: 16 is not a valid SoundFormat #21

PiSaucer opened this issue May 3, 2023 · 1 comment

Comments

@PiSaucer
Copy link

PiSaucer commented May 3, 2023

I am unable to convert FSB version 5 files.

Command:

python3 extract.py file.fsb

Error Message:

Traceback (most recent call last):
  File "C:\python-fsb5_win64\extract.py", line 131, in <module>
    main()
  File "C:\python-fsb5_win64\extract.py", line 127, in main
    exit(app.run(sys.argv[1:]))
  File "C:\python-fsb5_win64\extract.py", line 121, in run
    self.handle_file(f)
  File "C:\python-fsb5_win64\extract.py", line 99, in handle_file
    fsb, ext = self.load_fsb(data)
  File "C:\python-fsb5_win64\extract.py", line 55, in load_fsb
    fsb = fsb5.load(data)
  File "C:\python-fsb5_win64\fsb5\__init__.py", line 230, in load
    return FSB5(data)
  File "C:\python-fsb5_win64\fsb5\__init__.py", line 124, in __init__
    self.header = self.header._replace(mode=SoundFormat(self.header.mode), size=buf.tell())
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\enum.py", line 384, in __call__
    return cls.__new__(cls, value)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\enum.py", line 702, in __new__
    raise ve_exc
ValueError: 16 is not a valid SoundFormat
@lyrinka
Copy link

lyrinka commented Jul 7, 2024

I'm having the exact same issue and had to hard code 16 as a dummy format to suppress the exception.

16 is FADPCM format, it's not new but haven't found a lot of support in external tools. I'm not sure whether this library is still maintained but I see some other in progress work for reference: SamboyCoding/Fmod5Sharp#7

Update: I found a working implementation in vgmstream https://github.com/vgmstream/vgmstream/blob/master/src/coding/fadpcm_decoder.c#L17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants