Author Topic: C++ and C# for music sound.  (Read 4846 times)

0 Members and 1 Guest are viewing this topic.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
C++ and C# for music sound.
« on: December 27, 2009 »
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.html

Example using irrKlang in C++

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

Code: [Select]
#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:
Code: [Select]
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
« Last Edit: December 28, 2009 by Hotshot »

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: C++ and C# for music sound.
« Reply #1 on: January 03, 2010 »
very intriging im after something like fmod / bass sound quality but without the dll, havent downloaded at present, irrKlang can be used statically only with purchasing a license.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: C++ and C# for music sound.
« Reply #2 on: January 03, 2010 »
im after something like fmod / bass sound quality but without the dll
What features do you need that miniFMod can't accomplish?
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: C++ and C# for music sound.
« Reply #3 on: January 06, 2010 »
i've used bass more than any, it's stuff like the filters, 3D Surround, Channel Mixing, automatic looping / ramping. as when I play a tune in winamp, mad tracker, bass or bass mod it sounds a lot different to how it is outputted in MiniFMOD / ufmod.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won: