SFML community forums
Bindings - other languages => DotNet => Topic started by: Felheart on November 03, 2011, 05:45:11 pm
-
Hello
consider this little program:
using SFML.Audio;
using SFML.Graphics;
using SFML.Window;
namespace SFML2
{
static class Program
{
static RenderWindow _window;
public static void Main(string[] args)
{
_window = new RenderWindow(new VideoMode(800, 500), "Title", Styles.Default, new ContextSettings(32, 0, 8, 999, 999));
SoundBuffer buffer = new SoundBuffer("ui3.wav");
Sound sound = new Sound(buffer);
while (_window.IsOpened())
{
_window.WaitAndDispatchEvents();
sound.Play();
_window.Display();
}
}
}
}
In my VS project I have the following files:
csfml-audio-2.dll
csfml-graphics-2.dll
csfml-window-2.dll
sfmlnet-audio.dll
sfmlnet-graphics.dll
sfmlnet-window.dll
All set to: Copy if newer.
The program runs and crashes with the error:
System.DllNotFoundException csfml-audio-2.dll could not be found
(or something similar, my VS is in german)
But all files are there. I tried drawing simple sprites and it works.
How do I fix this?
Thanks for any help in advance. I really like sfml (and its bindings :D)
-
You also need sndfile.dll and openal32.dll.
-
Thanks,
now it doesn't crash. But my wav file does not play.
I have 5 files, but only 3 of them are being played.
Could you have a look at it please?
Here is one of the files that doesn't play: http://dl.dropbox.com/u/3192286/ui3.rar
The others are just silent
-
I tried many different files now but it's very strange, some sounds play and some don't.
But I can't find a reason why.
-
Any error message in the console?
Have you tried to play these files with a regular audio player?
-
No error message in the console.
And yes I tried winamp and windows media player. Both play the file correctly.