Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - coogison

Pages: [1]
1
DotNet / Re: Request help with getting sound from resources
« on: January 27, 2014, 11:15:13 pm »
Thank yuo all for pointing me to the right direction. But problem was somewhere else.

I didnt copy all sounds dll-s into application directory, and because i encountered this strange behaviour during application initalization it was a bit ungly to solve it out. (hidden error message)

2
DotNet / Request help with getting sound from resources
« on: January 27, 2014, 09:01:33 pm »
Hello, i wrote small unit which allows me to create textures, sounds and fonts i am using in my small application.

Fonts and Images working fine like this examples (its not the best way probably, but it works :))

    public static class Constants
    {
        // fonts
        public static Font textFont = GetFont("frquad");  

        public static Font GetFont(String AResourceName)
        {
            byte[] bytes = (byte[])Properties.Resources.ResourceManager.GetObject(AResourceName);
            MemoryStream str = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(str);
            writer.Write(bytes);
            str.Position = 0;
            return new Font(str);
        }
    }

.... but i cant load sound in a similar way. All the time i failed creating SoundBuffer from stream which i want to load from resources.

Any help appreciated.

Thanks a lot,

coogison

Pages: [1]