Home About Forum Imprint Terms and Conditions Contact
Ambiera logo irrKlang logo

irrKlang

irrKlang is a cross platform sound library for C++, C# and all .NET languages. Read more



irrKlang is free for non-commercial use.
The commercial version is named 'irrKlang pro' and has pricing schemes ideal for independent developers.



Example using irrKlang in C++

This C++ example code shows how to play an mp3 file:

#include <iostream>
#include <irrKlang.h>
using namespace irrklang;
int main(int argc, const char** argv) { // start the sound engine with default parameters ISoundEngine* engine = createIrrKlangDevice();

if (!engine)
return 0; // error starting up the engine
// play some sound stream, looped engine->play2D("somefile.mp3", true); char i = 0; std::cin >> i; // wait for user to press some key engine->drop(); // delete engine return 0; }
This code works on all supported platforms (currently Windows, Linux and MacOSX). For more examples and information about using irrKlang in C++, take a look at the irrKlang C++ API documentation.

Example using irrKlang in C#

The following example was written in C# and shows how to play an mp3 file:

using IrrKlang; 

namespace HelloWorld
{
  class Example
  {
   [STAThread]
   static void Main(string[] args)
   {
     // start up the engine
     ISoundEngine engine = new ISoundEngine();

     // play a sound file
     engine.play2D("somefile.mp3");

     // wait until user presses ok to end application
     System.Windows.Forms.MessageBox.Show("Playing, press ok to end.");

   } // end main()

  } // end class

} // end namespace
For more examples and information about using irrKlang in .NET languages like C#, VisualBasic, Delphi.NET and similar take a look at the irrKlang .NET API documentation.