You only need to download irrKlang and add the irrKlang.NET.DLL file as reference to your project.
// Minimal Windows.Forms program in CSharp
// to play back an .ogg, mp3, .mod, .wav etc file:
public class PlayerWindow : Form
irrKlang.ISoundEngine soundEngine = new irrKlang.ISoundEngine();
static void Main()
// setup window
Button playButton = new Button();
Button stopButton = new Button();
playButton.Location = new System.Drawing.Point(48, 78);
playButton.Text = "Play";
playButton.Click += new System.EventHandler(PlayButton_Click);
stopButton.Location = new System.Drawing.Point(173, 78);
stopButton.Text = "Stop";
stopButton.Click += new System.EventHandler(StopButton_Click);
private void PlayButton_Click(object sender, EventArgs e)
// replace the filename with the file you want to play.
// copy the ikpmp3.dll to your bin\Debug (or working) path if you want
// to play back mp3 files
private void StopButton_Click(object sender, EventArgs e)
if (currentlyPlayingSound != null)
currentlyPlayingSound = null;
I really don't understand what the big deal is, it should not be that difficult. :)
two comments, already:
I never really used IrrKlang before, I think my question could be answered by just reading the docs, but anyway: how are the sound objects disposed?
Shouldn’t you be calling something like
when you play a new sound or does the engine take care of everything? How do you manage resources in this case?
Lorenz Cuno Klopfenstein (link) - 29 07 08 - 13:18
Basically, irrKlang ist written in C++ and the sound engine manages the resources nearly by itself, so you don’t have to think much about this. The data in the ISound interface will be garbage collected automaticly by the .net gc, and when this happens, it usually only frees a few bytes of the managed code. But of course, you still could call dispose yourself earlier as well.
niko - 29 07 08 - 18:29