Clip actions are buffering for 4 different devices.
All buffers have a duration of 30 seconds.
Background
Given the above scenario, the memory usage of Sound Deck is ~240MB to ~260MB, which is quite high given that the average 30 second clip requires approximately 10-15MB of uncompressed bytes.
Change
Sound Deck currently uses a buffer based on time; instead, it should use the AverageBytesPerSecond property provided by NAudio to determine how many bytes should be stored within a fixed sized circular buffer for a given time frame. Additionally, if possible, Sound Deck should utilize Span<byte> to improve memory management.
With the above setup applied, the new memory usage is ~68MB. There is also more aggressive garbage collection for the LOH as this does not require persistence after the file has been saved.
Setup
Background
Given the above scenario, the memory usage of Sound Deck is ~240MB to ~260MB, which is quite high given that the average 30 second clip requires approximately 10-15MB of uncompressed bytes.
Change
Sound Deck currently uses a buffer based on time; instead, it should use the
AverageBytesPerSecond
property provided by NAudio to determine how many bytes should be stored within a fixed sized circular buffer for a given time frame. Additionally, if possible, Sound Deck should utilizeSpan<byte>
to improve memory management.