Question on waveOutOpen()

10fc6768b9a699f5f09a20ea07863a20
0
Marklee 101 Apr 13, 2005 at 13:54

What would cause this to return a code of MMSYSERR_INVALFLAG(10)? I’m at a loss on how to troubleshoot this.

8 Replies

Please log in or register to post a reply.

065f0635a4c94d685583c20132a4559d
0
Ed_Mack 101 Apr 13, 2005 at 14:38

Which API? openAL?

10fc6768b9a699f5f09a20ea07863a20
0
Marklee 101 Apr 13, 2005 at 14:46

@Ed Mack

Which API? openAL? [snapback]17153[/snapback]

waveOutOpen() imported from winmm.dll.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Apr 13, 2005 at 18:15

Well, it’s yelling about an invalid flag, so the obvious question is…what are you passing in for the flags parameter?

10fc6768b9a699f5f09a20ea07863a20
0
Marklee 101 Apr 13, 2005 at 18:26

I’m passing in 0x00030000 as the last parameter, which is CALLBACK_FUNCTION.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Apr 13, 2005 at 19:05

Make sure the dwCallback parameter is the address of a function with the proper prototype. The callback function must also be declared with the CALLBACK calling convention.

Also try adding WAVE_ALLOWSYNC to the flags, just to see if this makes it work.

10fc6768b9a699f5f09a20ea07863a20
0
Marklee 101 Apr 13, 2005 at 19:54

@Reedbeta

Make sure the dwCallback parameter is the address of a function with the proper prototype. The callback function must also be declared with the CALLBACK calling convention.

Also try adding WAVE_ALLOWSYNC to the flags, just to see if this makes it work.

[snapback]17160[/snapback]

Ok, I tried that, but I’m getting the same return code. The thing is, I don’t really think the flag is where the problem is. I can call waveOutOpen() with a format(3rd parameter) of PCM, and everything would be fine. But if I change the format to GSM610 and leave all the other parameters the same, I get an invalid flag return code. I don’t think its the callback function either, since it works if I set the format to PCM.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Apr 13, 2005 at 21:17

Hmm…I don’t know much of anything about the GSM codec. Possibly it’s not supported by the wavOut functions, but needs a third-party library to decode?

10fc6768b9a699f5f09a20ea07863a20
0
Marklee 101 Apr 13, 2005 at 21:30

@Reedbeta

Hmm…I don’t know much of anything about the GSM codec. Possibly it’s not supported by the wavOut functions, but needs a third-party library to decode? [snapback]17162[/snapback]

I believe its supported as long as you have the codec. I know its supported because I have source code in C++ that uses it, and when I compile it, it works using the GSM610 format. But I’m trying to convert it to C#, and that’s where I’m getting stuck on because I’m getting an error code of 10 back when trying to use waveOutOpen().