Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Play Sounds Simultaneously

Zel24
Guest
Quote
2012-07-24 14:43:20

Hi everybody ;-)

I'm trying to play 3 sounds simultaneously, but it won't work :-(

void playC() {


ISoundEngine* soundEngine = createIrrKlangDevice();

string soundFile = "C.mp3";

soundEngine->play2D(soundFile.c_str());



}
void playE() {

ISoundEngine* soundEngine = createIrrKlangDevice();

string soundFile = "E.mp3";

soundEngine->play2D(soundFile.c_str());


}

void spieleG() {

ISoundEngine* soundEngine = createIrrKlangDevice();

string soundFile = "G.mp3";

soundEngine->play2D(soundFile.c_str());


}



If i try to play them simultaneously in this way:


private: System::Void C_Click(System::Object^ sender, System::EventArgs^ e) {
playC();
playE();
playG();


}


C++ will play them one after another AND disordered, he should play C, E, G simultaneously but plays, I think: E.......C......G

Someone can help?


niko
Moderator
Quote
2012-07-25 09:55:00

The problem is maybe that you are starting irrklang sound engines, each time you want to play a sound. Do this only once, for example when starting the program. The sound engine object is a very heavy object, and there should be only once living at a time in your program.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact