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

Reduce memory usage requires of audio buffers (clip audio) #49

Closed
GeekyEggo opened this issue Oct 17, 2021 · 1 comment
Closed

Reduce memory usage requires of audio buffers (clip audio) #49

GeekyEggo opened this issue Oct 17, 2021 · 1 comment
Assignees
Labels
⭐ enhancement An enhancement or new feature!
Milestone

Comments

@GeekyEggo
Copy link
Owner

Setup

  • 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.

@GeekyEggo GeekyEggo changed the title Reduce memory usage Reduce memory usage requires of audio buffers (clip audio) Oct 17, 2021
@GeekyEggo GeekyEggo self-assigned this Oct 17, 2021
@GeekyEggo
Copy link
Owner Author

Results

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.

@GeekyEggo GeekyEggo added ⭐ enhancement An enhancement or new feature! and removed ⚡ enhancement labels Nov 7, 2021
@GeekyEggo GeekyEggo added this to the vNext milestone Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement An enhancement or new feature!
Projects
None yet
Development

No branches or pull requests

1 participant