mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-28 07:47:02 -05:00
patterns: Added RAD Game Tools BINKA hexpat (#319)
* Binka readme * Binka hexpat
This commit is contained in:
@@ -38,6 +38,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
|
||||
| BLEND | | [`patterns/blend.hexpat`](patterns/blend.hexpat) | Blender Project file |
|
||||
| BMP | `image/bmp` | [`patterns/bmp.hexpat`](patterns/bmp.hexpat) | OS2/Windows Bitmap files |
|
||||
| BIN | | [`patterns/selinux.hexpat`](patterns/selinux.pat) | SE Linux modules |
|
||||
| BINKA | | [`patterns/binka.hexpat`](patterns/binka.pat) | RAD Game Tools Bink Audio (BINKA) files |
|
||||
| BSON | `application/bson` | [`patterns/bson.hexpat`](patterns/bson.hexpat) | BSON (Binary JSON) format |
|
||||
| bplist | | [`patterns/bplist.hexpat`](patterns/bplist.hexpat) | Apple's binary property list format (bplist) |
|
||||
| BSP | | [`patterns/bsp_goldsrc.hexpat`](patterns/bsp_goldsrc.hexpat) | GoldSrc engine maps format (used in Half-Life 1) |
|
||||
|
||||
24
patterns/binka.hexpat
Normal file
24
patterns/binka.hexpat
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma author DexrnZacAttack
|
||||
#pragma description RAD Game Tools BINKA (Bink Audio)
|
||||
#pragma magic [31 46 43 42] @ 0x00
|
||||
|
||||
import std.string;
|
||||
import std.math;
|
||||
import type.magic;
|
||||
|
||||
fn getDuration(u32 duration_ts, u32 sample_rate) {
|
||||
return float(duration_ts) / float(sample_rate);
|
||||
};
|
||||
|
||||
struct Binka {
|
||||
type::Magic<"1FCB"> magic;
|
||||
u8; // can't get this to change anything when using ffprobe
|
||||
u8 channel_count [[name(std::format("Channel Count: {}", this))]];
|
||||
u16 sample_rate [[name(std::format("Sample Rate: {}", this))]];
|
||||
u32 duration_ts [[name(std::format("Duration: {}s", std::math::floor(getDuration(this, sample_rate))))]];
|
||||
u32;
|
||||
u32 size [[name(std::format("File Size: {} bytes", this))]];
|
||||
u8 data[size - 20];
|
||||
};
|
||||
|
||||
Binka binka @ 0x00;
|
||||
Reference in New Issue
Block a user