Forum > Audio and Video

[SOLVED] Sound Callback

(1/2) > >>

pcurtis:
I was given the following code (DELPHI), see attachment, but can't get it to compile / work.

It's supposed to implement a callback for sound change notifications. It works as such but I cant compile

PostMessage(Handle, WM_VOLNOTIFY, WPARAM(pNotify.bMuted <> False), LPARAM(Round(100 * pNotify.fMasterVolume)));

If I change to

PostMessage(Handle, WM_VOLNOTIFY, 0, 0);

It works, but, of course, I get no information what has changed ...

Any help appreciated.

Thanks in advance.

pcurtis:
Just needed to dereference the pointer.

Fred vS:

--- Quote from: pcurtis on March 16, 2021, 11:01:45 am ---Just needed to dereference the pointer.

--- End quote ---

Hello PCurtis.

Congrats, you did it ! ;D


--- Quote ---If I change to

PostMessage(Handle, WM_VOLNOTIFY, 0, 0);

It works, but, of course, I get no information what has changed ...
--- End quote ---

You have more luck than me, even changing this in your demo (that compiles out-of-the-box) here nothing appends if I change the Windows-mixer-volume, the callback does not start.

[EDIT] Ooops, no, sorry, it works perfectly on Windows 10 (but not via Linux wine emulator).

Many thanks to share this code (and thanks to Him if he helped you).


Fre;D

pcurtis:
Try this (attachment)

Win 10, Laz 2.0.12

Fred vS:
Hello Curtis.

Re-oops we sent the post together, please take a look at my [EDIT].

I will try your new code now.

Fre;D

Navigation

[0] Message Index

[#] Next page

Go to full version