Working with sound on a pc isn't a pascal or laz thing so u must be using a lib, unit, functions u found somewhere ? U need to show the code in more complete format so u can be helped. Otherwise here we are rolling dice.
Title: Re: System Audio Mute
Post by: pcurtis on October 29, 2020, 02:19:00 pm
All the code is in the attachment with the opening post.
Title: Re: System Audio Mute
Post by: jamie on October 29, 2020, 11:42:21 pm
your problem deals with the fact that Windows which uses a C/C++ among others that SetMute function does not treat a non 0 value as true but is looking for a specific value of 1 for true.,.
Infact, I wonder if the declaration of the function is even correct?
The NOT operator isn't flipping the first the first bit but instead flipping the whole container holding the boolean..
so you either have a a 0 for false or -1 for true..
that function does not work with -1 for true and because that field is most likly not treated as a boolean it should be numerical instead
So to recap on this, if you still want to use a boolean, use a LONGBOOL for the definitions instead and do this just prior to using it in the function