Fsbex
Rust library for extracting audio from FMOD sound banks
Install / Use
/learn @astral4/FsbexREADME
fsbex
fsbex is a library for extracting audio from FMOD sound banks. Only FSB version 5 is supported for now.
Example
Parsing a sound bank, then writing streams to files:
use fsbex::{Bank, AudioFormat};
use std::{
error::Error,
io::{BufReader, BufWriter},
fs::File,
};
fn main() -> Result<(), Box<dyn Error>> {
// open file for reading sound bank
let file = BufReader::new(File::open("example.fsb")?);
let bank = Bank::new(file)?;
// report number of streams contained within the sound bank
println!("{} streams within this sound bank", bank.num_streams());
// check stream audio format
if bank.format() != AudioFormat::Vorbis {
return Err("expected Vorbis format".into());
}
// iterate over streams
for (index, stream) in bank.into_iter().enumerate() {
// check stream name
let file_name = if let Some(name) = stream.name() {
format!("{name}.ogg")
} else {
format!("stream_{index}.ogg")
};
// write stream data to file
let output_file = BufWriter::new(File::create(file_name)?);
stream.write(output_file)?;
}
Ok(())
}
Supported formats
fsbex supports encoding stream data for the following formats:
- PCM (8, 16, 24, 32-bit integer)
- PCM (32-bit float)
- Vorbis
Acknowledgements
fsbex would not be possible without these projects:
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Related Skills
himalaya
351.4kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
taskflow
351.4kname: taskflow description: Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layer
qqbot-channel
351.4kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.6k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
