diff options
author | Chris Robinson <[email protected]> | 2023-02-14 00:00:46 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-02-14 02:32:07 -0800 |
commit | d0c28c652f10856f3f1eadbbe8f362be6224355d (patch) | |
tree | 93fc754d14acb8f89f595e62a1672e3be1a05354 /core/buffer_storage.h | |
parent | c10df8ab545320e636404a8ed5f81b2c08c565b3 (diff) |
Support IMA4 ADPCM as a mixing voice format
Diffstat (limited to 'core/buffer_storage.h')
-rw-r--r-- | core/buffer_storage.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/buffer_storage.h b/core/buffer_storage.h index ec934681..a4d1b289 100644 --- a/core/buffer_storage.h +++ b/core/buffer_storage.h @@ -18,6 +18,7 @@ enum FmtType : unsigned char { FmtDouble, FmtMulaw, FmtAlaw, + FmtIMA4, }; enum FmtChannels : unsigned char { FmtMono, @@ -83,6 +84,7 @@ struct BufferStorage { FmtChannels mChannels{FmtMono}; FmtType mType{FmtShort}; uint mSampleLen{0u}; + uint mBlockAlign{0u}; AmbiLayout mAmbiLayout{AmbiLayout::FuMa}; AmbiScaling mAmbiScaling{AmbiScaling::FuMa}; @@ -93,6 +95,12 @@ struct BufferStorage { { return ChannelsFromFmt(mChannels, mAmbiOrder); } inline uint frameSizeFromFmt() const noexcept { return channelsFromFmt() * bytesFromFmt(); } + inline uint blockSizeFromFmt() const noexcept + { + if(mType == FmtIMA4) return ((mBlockAlign-1)/2 + 4) * channelsFromFmt(); + return frameSizeFromFmt(); + }; + inline bool isBFormat() const noexcept { return IsBFormat(mChannels); } }; |