Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / May 2007



Tip: Looking for answers? Try searching our database.

strange behaviour of mixerGetLineInfo-API

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thomas Hoffmann - 27 May 2007 14:34 GMT
Hi,
I'm using the class clsvolume (on gssg.de -
vbclassic-multimedia-volume1) since years for adjusting volume-levels.
Using W2K SP4

Changed now mainboard and CPU, put on the new drivers, didn't bring up
the whole system new. Everything words fine except the above mentioned
Api. I'm using the old soundcard as PCI-card, the new board has sound
on board.
When I disable onboard-sound in the bios, everythings ok, otherwise
the error as described occurs:

'open the mixer:
rc = mixerOpen(hMixer, 0, 0, 0, 0) 'ist ok

'then Get the waveout volume control

  mxl.cbStruct = Len(mxl)  'mxl as mixerline defined (s.b.)
  mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
  rc = mixerGetLineInfo(hMixer, mxl, MIXER_GETLINEINFOF_COMPONENTTYPE)

rc returns 11 here, that is
Private Const MMSYSERR_INVALPARAM As Long = (MMSYSERR_BASE + 11).

later calls for this api with:

mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_LINE

return NO_ERROR

I cannot understand this behaviour. Can anybody explain me what to do?

Thanks in advance! TH

Private Type MIXERLINE
    cbStruct As Long                  '  size of MIXERLINE structure
    dwDestination As Long             '  zero based destination index
    dwSource As Long                  '  zero based source index (if
source)
    dwLineID As Long                  '  unique line id for mixer device
    fdwLine As Long                   '  state/information about line
    dwUser As Long                    '  driver specific information
    dwComponentType As Long           '  component Private Type line
connects to
    cChannels As Long                 '  number of channels line supports
    cConnections As Long              '  number of connections (possible)
    cControls As Long                 '  number of controls at this line
    szShortName As String * MIXER_SHORT_NAME_CHARS
    szName As String * MIXER_LONG_NAME_CHARS
    dwType As Long
    dwDeviceID As Long
    wMid  As Integer
    wPid As Integer
    vDriverVersion As Long
    szPname As String * MAXPNAMELEN
End Type
Signature

Thomas Hoffmann

Mark Yudkin - 28 May 2007 09:08 GMT
I wonder if mixerOpen is returning the (disabled) on-board device, since you
have more than one (what does mixerGetNumDevs return?). I suspect you'll
need to specify the device you want.

> Hi,
> I'm using the class clsvolume (on gssg.de - vbclassic-multimedia-volume1)
[quoted text clipped - 53 lines]
>     szPname As String * MAXPNAMELEN
> End Type
Thomas Hoffmann - 28 May 2007 10:29 GMT
Hi Mark,
you are right with that.
disabled onboard sound in bios returns two devices:

SB Live!-Wavegerät
Tunebite High-Speed Dubbing

enabled onboard sound adds two further:

Soundmax HD Audio I
Soundmax HD Audio O

MSDN writes: http://msdn2.microsoft.com/en-us/library/aa910250.aspx
"The device identifier specified by uMxId varies from zero to one less
than the number of devices present."
So I always get the first mixer-device when calling the API with a
zero as second param.

But how can I force mixeropen to retrieve the defaultmixer-device, the
one I set in the Sound-Properties in "Einstellungen" (don't know what
that startmenu-item is called in english).

Thanks for help TH

Mark Yudkin schrieb:
> I wonder if mixerOpen is returning the (disabled) on-board device, since you
> have more than one (what does mixerGetNumDevs return?). I suspect you'll
> need to specify the device you want.

Signature

Thomas Hoffmann

Mark Yudkin - 28 May 2007 16:46 GMT
Einstellung is setup, but in the Sound Properties it's under Audio.
Fortunately, I've never been forced to work with a German Windows (my poor
wife has to, and then I get mails asking for English translations so she can
work out what's going on - and she's Swiss German)

---

Unfortunately, I don't know the answer to your question. Try googling for it

> Hi Mark,
> you are right with that.
[quoted text clipped - 24 lines]
>> you have more than one (what does mixerGetNumDevs return?). I suspect
>> you'll need to specify the device you want.
Roger Evrard - 30 May 2007 10:51 GMT
I suspect that the mixer nr 0 opened with rc = mixerOpen(hMixer, 0, 0, 0, 0) does not support the type speakers (type 4, I think).Your other mixer should have the ID 1 and should open with rc = mixerOpen(hMixer, 1, 0, 0, 0), I think. For more detail, see http://www.borg.com/~jglatt/tech/mixer.htm.
I run this piece of code on my PC and got an error message 11, except for i = 0, 4, and 7.
newLine = Chr(13) & Chr(10)
 textBuffer = ""
 mxl.cbStruct = Len(mxl)
 
   For i = 0 To 10
   mxl.dwComponentType = i
   getLineSuc = mixerGetLineInfo(hmixer, mxl, 3)
   trimName = ""
     For j = 1 To Len(mxl.szName)
       If Asc(Mid(mxl.szName, j, 1)) <> 0 Then trimName = trimName + Mid(mxl.szName, j, 1)
     Next j
  textBuffer = textBuffer & getLineSuc & "  " & i & "  " & trimName & newLine
  Next i
 Text1.Text = textBuffer
Hope this can be of some help to you.

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.