SFML community forums

Bindings - other languages => DotNet => Topic started by: Felheart on November 03, 2011, 05:45:11 pm

Title: Cannot load csfml-audio-2
Post by: Felheart on November 03, 2011, 05:45:11 pm
Hello

consider this little program:

Code: [Select]


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)
Title: Cannot load csfml-audio-2
Post by: Laurent on November 03, 2011, 07:28:42 pm
You also need sndfile.dll and openal32.dll.
Title: Cannot load csfml-audio-2
Post by: Felheart on November 03, 2011, 08:24:29 pm
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
Title: Cannot load csfml-audio-2
Post by: Felheart on November 04, 2011, 08:46:38 am
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.
Title: Cannot load csfml-audio-2
Post by: Laurent on November 04, 2011, 09:15:02 am
Any error message in the console?

Have you tried to play these files with a regular audio player?
Title: Cannot load csfml-audio-2
Post by: Felheart on November 04, 2011, 10:20:20 am
No error message in the console.
And yes I tried winamp and windows media player. Both play the file correctly.