irrKlang is a cross platform sound library for C++, C# and all .NET languages.
irrKlang's current features are:
* Plays multiple file formats, .WAV, .MP3, .OGG, .MOD, .XM, .IT, .S3M...
http://www.ambiera.com/irrklang/index.htmlExample 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;
}
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