0
0

Hello,

I’m currently developing a Win32-Service (find the code [url=http://pastebin.com/779899:2uo1g582]here[/url:2uo1g582]; it’s in line 88 where wmus_main() gets called) that should play a sound:

[code:2uo1g582]
void wmus_main(void)
{
FILE *debug_stream;
// initialize fmod
if (!FSOUND_Init(44100, 64, 0))
{
debug_stream = fopen("c:\temp\wmus.log", "w");
fprintf(debug_stream, "%s\n", FMOD_ErrorString(FSOUND_GetError()));
fclose(debug_stream);
exit(EXIT_FAILURE);
}
...
}
[/code:2uo1g582]

The Error, I get is called like this:
"Error setting cooperative level for hardware."

I googled a bit around and found out, that it looks like a DirectSound issue. Maybe it has something to do with a window-handler (HWND), that’s missing with win32-services? I’m not that experienced with that. FSOUND_Init returns with a success return value, when the code gets executed on the command-line (i created a dedicated test-application for that).

Compilation was done with Visual C++ 7.1 (MS Visual Studio .NET 2003) my Operating System is MS Windows XP Professional with SP2.

Best regards and thanks for reading,
Rainer

  • You must to post comments
0
0

Try using FSOUND_SetHWND, it is something to do with there not being any foreground window.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.