Jump to content

Monitoring system's mixer equalizer


dragan
 Share

Recommended Posts

I'm always getting ret. val for this function larger than 0:

Local $lpszReturnString
$mciLevel = DllCall('winmm.dll', 'long', 'mciSendStringA', 'str', 'status mywave level', 'str', $lpszReturnString, 'long', 64, 'long', 0)
;now my $mciLevel[0] = 328, and $mciLevel[2] is blank and I cannot get any values, why is that?

P.S. I'm using windows 7 x64

P.S.S. full script is this:

Local $Form = GUICreate('Sound level', 220, 50)
Local $Label1 = GUICtrlCreateLabel('000', 10, 10, 30)
GUISetState(@SW_SHOW, $Form)
Local $lpszReturnString
Local $mciInit = DllCall('winmm.dll', 'long', 'mciSendStringA', 'str', 'open new type waveaudio alias mywave', 'str', $lpszReturnString, 'long', 64, 'long', 0)
If $mciInit[0] <> 0 Then Exit
Do
    $mciLevel = DllCall('winmm.dll', 'long', 'mciSendStringA', 'str', 'status mywave level', 'str', $lpszReturnString, 'long', 64, 'long', 0)
    If $mciLevel[0] <> 0 Then
        MsgBox(0, 'Error', 'Script will now close')
        Exit
    EndIf
    GUICtrlSetData($Label1, $mciLevel[2])
Until GUIGetMsg() = -3
GUIDelete($Form)
Exit
Link to comment
Share on other sites

Do you have to use that code? Theres a Bass UDF for sound and music functions that will make what your trying to do pretty easy

Link to comment
Share on other sites

I have seen the bass udf, but with bass library I can monitor only channels that's been playing with bass.dll file, and I cannot monitor system's equalizer level.

(Or I missed something with the bass UDF :graduated:, plz correct me if I'm wrong with the statement above.)

Link to comment
Share on other sites

I have seen the bass udf, but with bass library I can monitor only channels that's been playing with bass.dll file, and I cannot monitor system's equalizer level.

(Or I missed something with the bass UDF :graduated:, plz correct me if I'm wrong with the statement above.)

Im not sure but your probably right about the only bass channels. I ran your script and from what I can tell everything was working fine. ;) $mcilevel[2] did not come back blank for me. The number was bouncing right along with the music playing so I think Im missing something?

Link to comment
Share on other sites

What is your OS? 'Cause I think it might be something wrong with the OS architecture and that function, that's why I mention that my OS is Win7 64-bit. I can't even get to $mcilevel[2] value, my script get stopped at part:

If $mciLevel[0] <> 0 Then
        MsgBox(0, 'Error', 'Script will now close')
        Exit
    EndIf
and for this function to work properly this value must be 0, if I remove this check I just get $mcilevel[2] as blank/null value.

P.S. I also tried running upper function with command:

#AutoIt3Wrapper_UseX64=n
Link to comment
Share on other sites

Im running win7 64 also. Very weird... It should be returning an error if it dosent return 0. Have you tried getting it?

From MSDN: "Returns zero if successful or an error otherwise. The low-order word of the returned DWORD value contains the error return value. If the error is device-specific, the high-order word of the return value is the driver identifier; otherwise, the high-order word is zero. For a list of possible error values, see MCIERR Return Values."

Edited by Beege
Link to comment
Share on other sites

That's odd, I've used error check and I got this message:

MCI Error Number 328:No wave device is installed that can record files in the current format. To install a wave device, go to Control Panel, click Printers and Other Hardware, and then click Add Hardw

however I have installed driver for my integrated sound card (MSI P67-GD55 motherboard), and it's working properly, and I have nothing disabled in the device manager.

Link to comment
Share on other sites

Solved...

It seems that by default, mixer is disabled and hidden from Sound recording features for my drivers. So I had to go to Control Panel > Sound > Recording, turn on Show disabled devices and enable Stereo Mix. Tnx for help :graduated: it's all working normally now.

Link to comment
Share on other sites

if you right click on the volume tray icon, and go to recording devices, do any appear?

Also I never used 'mciSendStringA', but im looking at the command 'set' and it might be something you need to use??

http://msdn.microsoft.com/en-us/library/dd798661(v=vs.85).aspx

Link to comment
Share on other sites

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...