Metadata-Version: 2.1
Name: fmod_toolkit
Version: 0.1.3
Author-email: Rudolf Kolbe <rkolbe96@gmail.com>
License: MIT License
        
        Copyright (c) 2025 K0lb3
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/K0lb3/fmod_toolkit
Project-URL: Bug Tracker, https://github.com/K0lb3/fmod_toolkit/issues
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Games/Entertainment
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyfmodex>=0.7.2
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: fmod-toolkit[tests]; extra == "dev"
Provides-Extra: tests
Requires-Dist: pytest; extra == "tests"

# fmod_toolkit

`fmod_toolkit` is a lightweight Python package designed to extract and export audio from FMOD files to WAV format.
It includes pre-bundled FMOD libraries for Windows, macOS, and Linux, enabling seamless cross-platform usage without manual library installation.

The libraries shipped with the package are FMOD Engine 2.00.10,
which is one of the last versions that used u16 instead of f32 for sampling.

The linux libraries have their executable stack flag cleared.
(``execstack -c libfmod.so``)

## usage

FSB files can be loaded, RIFF based ``.bank`` files fail at the moment.
It's possible to use a different FMOD library by setting the environment variable ``PYFMODEX_DLL_PATH``.
This is necessary on platforms this package doesn't ship FMOD libraries for.

```py
from fmod_toolkit import raw_to_wav

# fsb_data: bytes containing the FMOD sound bank (FSB) file
fsb_data: bytes = ...  # Load your FSB file data here
# fsb_basename: base name for output WAV files (e.g., "soundbank")
fsb_basename: str = "soundbank"
# channels: number of audio channels (e.g., 2 for stereo)
channels: int = 2
# sample_rate: desired output sample rate (e.g., 44100 Hz)
sample_rate: int = 44100

# Convert FSB data to WAV files
for filename, filedata in raw_to_wav(fsb_data, fsb_basename, channels, sample_rate):
    # Save each WAV file to disk
    with open(filename, "wb") as f:
        f.write(filedata)
```
