1

I have a C# winform app. It handles some sound effects.

I was wondering whether I should make them embedded resources or put them in folders in the app directory.

I don't want the user of my app to mess with them. That's why I don't wanna put them in folders, but also, there's a problem I think. Their size in total is about 150 Migs, so if I'm gonna make them Embedded, will that size effect the performance of my App?

If so, will compressing them in ZIP files really help?

typ1232
  • 5,535
  • 6
  • 35
  • 51
vexe
  • 5,433
  • 12
  • 52
  • 81

2 Answers2

2

There is no correct answer to this - but here is my $0.02.

I think that you should leave them separate and not worry if the user messes with them. If it is really important that they don't ever change make a hash of the file and store the hash then then throw an error if they change. Including them in the binary probably will not help performance - and might hurt your load time, but it will make your exe bigger and make it more difficult to update and deploy.

Neil
  • 1,605
  • 10
  • 15
1

You should not embed 150MBs of sound files in a exe!

Assuming you will use a Windows Installer (MSI), include the files into the installer and you can play the files in debug mode and in release mode:

string file = @"C:\TFS\DevProject\bin\Debug\Metallica.resources";
file = file.Replace("\bin\Debug\",string.Empty);
file = file.Replace(".resources",".mp3");
System.Diagnostic.Process.Start(file);

Note: The resources extension (rather than mp3 or etc) so users wont know how to open them unless they do a binary analysis.

If you use a ClickOnce Deployment do a similar thing.

On updating your application dont include the media files...

Community
  • 1
  • 1
Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321