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

add ambisonic subtypes #72

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,11 @@ const KSDATAFORMAT_SUBTYPE_PCM: [u8; 16] = [0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
const KSDATAFORMAT_SUBTYPE_IEEE_FLOAT: [u8; 16] = [0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71];

const KSDATAFORMAT_SUBTYPE_AMBISONIC_B_FORMAT_PCM: [u8; 16] = [0x01, 0x00, 0x00, 0x00, 0x21, 0x07, 0xd3, 0x11, 0x86,
0x44, 0xc8, 0xc1, 0xca, 0x00, 0x00, 0x00];

const KSDATAFORMAT_SUBTYPE_AMBISONIC_B_FORMAT_IEE_FLOAT: [u8; 16] = [0x03, 0x00, 0x00, 0x00, 0x21, 0x07, 0xd3, 0x11, 0x86,
0x44, 0xc8, 0xc1, 0xca, 0x00, 0x00, 0x00];

impl WavSpec {
/// Get "stand-alone" wav header representing infinite or unknown size wav file.
Expand Down
2 changes: 2 additions & 0 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@ impl<R: io::Read> ChunksReader<R> {
let sample_format = match subformat {
super::KSDATAFORMAT_SUBTYPE_PCM => SampleFormat::Int,
super::KSDATAFORMAT_SUBTYPE_IEEE_FLOAT => SampleFormat::Float,
super::KSDATAFORMAT_SUBTYPE_AMBISONIC_B_FORMAT_PCM => SampleFormat::Int,
super::KSDATAFORMAT_SUBTYPE_AMBISONIC_B_FORMAT_IEE_FLOAT => SampleFormat::Float,
_ => return Err(Error::Unsupported),
};

Expand Down