Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Trouble when call createIrrKlangDevice() function

nyancat
Registered User
Quote
2012-07-17 10:07:22

I'm developping a game with DirectX 9.0 and using 'irrklang' as sound engine.

It works fine when any ouput device, such as speakers are plugged in. but it fails to create when nothing is plugged in as an output device. (I think it fails on Create phase).

In order to make my game work, I've made it to check and create it again when it didn't worked.

There must be a cleaner and much more elegant way to fix this problem. :)


I've checked 'createSoundDeviceList()' to count the number of output devices that causes initialization failure.

It fails when only one output device is on the list. But works fine when more than two devices show up.

Hope someone can help me with this situation.

OS : Window 7
Program : VS 2008 ver 9.0.30729.1 SP
irrKlang Ver : 1.3.0
Run-Time Library : Multithread (/MT)

ps. I recently upgraded 'irrklang' 1.3 to 1.4 and having some trouble compiling. Hope someone can tell me what has changed and if there is a tutorial that I can refer please help me.


thanks :)


niko
Moderator
Quote
2012-07-18 08:54:39

No, currently this is the way it works, you are right what you are doing. It's apparently Windows 7 (or some specific audio driver's) new way of managing audio support. This behavior has only recently been reported. For now, you would simply handle this as you are doing this already, but I think about adding support in irrKlang so this is handled internally.

About your compiling problems: What are those exactly?


nyancat
Registered User
Quote
2012-07-19 07:28:01

Your answer was very helpful. Thanks a lot.

But the answer to my compiling problems is insufficient. I'm sorry for something they are described in more detail with. In other words,My project need to be complied with multithread option(/MT).
But when i try to complie 1.4 with this option, it fials.
Changing MT option to multithread.dll compiles file but it doesn't wotk on runtime.

Can you do to resolve this situation?


niko
Moderator
Quote
2012-07-19 07:34:12

What error message do you get? Are you using the .dll version of irrklang, right?


nyancat
Registered User
Quote
2012-07-19 09:44:48

Error message : MSVCRT.lib(MSVCR90.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj).

I without the use static licensed 1.3 version library, using static library.


yogi.klatt
Registered User
Quote
2012-07-19 10:06:44

We had the same problem and haven't solved it so far. To avoid any crashes we're using the null driver:

mEngine = irrklang::createIrrKlangDevice(irrklang::ESOD_DIRECT_SOUND_8);
if(!mEngine)
{
mEngine = irrklang::createIrrKlangDevice(irrklang::ESOD_NULL);
}

But in any case it would be nice to have certain DirectSound API callbacks being forwarded through IrrKlang (there is a call that happens when you remove the speaker's plug). That way we could also check if the driver was dropped ... or recreate the Engine when speakers are plugged in again.


niko
Moderator
Quote
2012-07-20 07:35:30

If you need a irrklang.lib compiled with a different runtime version, just send me a mail, I'll send it to you then.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (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