Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is more memory efficient loading a wav file or using an embedded resource?

Tags:

c#

.net

memory

I need to use some 75 (small) .wav files in my Winforms C# application and was wondering which system is more efficient (memory wise) - loading a .wav from a file and playing the sound or using embedded resources?

If I use the file method, I take it the memory would be freed-up after the sound has been played. If I use resources I believe these would not be freed-up until...

like image 732
MartinHT Avatar asked Dec 11 '25 10:12

MartinHT


1 Answers

An embedded resource is still just part of your compiled assembly file, and it is not loaded into memory when the assembly is loaded, it is loaded as required. So there's no real difference memory-wise.

like image 140
Saeb Amini Avatar answered Dec 13 '25 00:12

Saeb Amini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!