Access audio files from resources
-
Hi, I have a problem with retrieving a wav file from the Resources folder. The wav is file has it build action stands on Embedded Resource. I thought to acces a png file I can use:
Bitmap bm = new Bitmap(GetType().Assembly.GetManifestResourceStream("image.png"));
So what to use to access a .wav file?Stream wav = System.Reflection.Assembly.GetManifestResourceStream("attention.wav");
? Thanks -
Hi, I have a problem with retrieving a wav file from the Resources folder. The wav is file has it build action stands on Embedded Resource. I thought to acces a png file I can use:
Bitmap bm = new Bitmap(GetType().Assembly.GetManifestResourceStream("image.png"));
So what to use to access a .wav file?Stream wav = System.Reflection.Assembly.GetManifestResourceStream("attention.wav");
? ThanksSystem.IO.Stream s = Properties.Resources.attention;
// the name of the resourceEslam Afifi
-
Hi, I have a problem with retrieving a wav file from the Resources folder. The wav is file has it build action stands on Embedded Resource. I thought to acces a png file I can use:
Bitmap bm = new Bitmap(GetType().Assembly.GetManifestResourceStream("image.png"));
So what to use to access a .wav file?Stream wav = System.Reflection.Assembly.GetManifestResourceStream("attention.wav");
? ThanksStream wav = Assembly.GetExecutingAssembly(). GetManifestResourceStream( MethodBase.GetCurrentMethod(). DeclaringType.Namespace + ".Resources." + "attention.wav");
(MethodBase.GetCurrentMethod().DeclaringType.Namespace assuming your calling from within the same namespace) Answered this for you in this thread[^]Dave
modified on Wednesday, March 5, 2008 4:22 AM