API
Package
pyawe_ffs
AWE FFS Creator/Parser
The programming interface is quite simple.
This is how to create a new file:
from pyawe_ffs.FfsContainer import FfsContainer
ffs = FfsContainer()
ffs.append("my_wavedata_1.wav")
ffs.append("my_wavedata_2.wav")
ffs.save("my_ffs_buffer.bin")
my_ffs_buffer.txt and my_ffs_buffer.csv.
The CSV file can typically be used in a TableSourceV2
module to map indices to file names.
An FFS buffer file can be read with and data extracted to a directory:
ffs = FfsContainer.from_file("my_ffs_buffer.bin")
for entry in ffs.entries:
print(f"- {entry}")
entry.store("/tmp")
If you also want to generate corresponding list and csv files (see above), you can use:
ffs = FfsContainer.from_file("my_ffs_buffer.bin")
ffs.save_filelist_txt("/tmp/mybuffer.txt")
ffs.save_filelist_csv("/tmp/mybuffer.csv")
Modules
pyawe_ffs.FfsContainer
pyawe_ffs.FfsContainer.FfsContainer
A container for several FFS entries
Source code in src/pyawe_ffs/FfsContainer.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
entries
property
property to return the list of FfsEntry values
append(fname, data=None)
adds a new file to the container
Source code in src/pyawe_ffs/FfsContainer.py
25 26 27 28 | |
from_file(fname, old_backend=False)
classmethod
creates a new FfsContainer based on an existing FFS file
Source code in src/pyawe_ffs/FfsContainer.py
35 36 37 38 39 40 41 42 43 44 | |
save(fname, dry_run=False)
stores the added file data into the bin buffer calls to the backend to convert the data
Source code in src/pyawe_ffs/FfsContainer.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
save_filelist_csv(fname)
saves the list of entries in a CSV file that can directly be used in Designer
This file is typically directly used in an Arrayset module which controls the file name property of a WaveOneShotPlayerFFS module.
Source code in src/pyawe_ffs/FfsContainer.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
save_filelist_txt(fname)
saves the list of entries into a TXT file as plain name
Source code in src/pyawe_ffs/FfsContainer.py
68 69 70 71 72 | |
pyawe_ffs.FfsEntry
pyawe_ffs.FfsEntry.FfsEntry
a data entry in an FFS container
Source code in src/pyawe_ffs/FfsEntry.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
path
property
returns the path to the mentioned file
store(outdir)
store the data of this FFS entry in an output directory
Source code in src/pyawe_ffs/FfsEntry.py
22 23 24 25 26 27 28 | |