Recent

Author Topic: play sound - loud ! - but only individually  (Read 1436 times)

Nicole

  • Hero Member
  • *****
  • Posts: 1009
play sound - loud ! - but only individually
« on: July 08, 2022, 10:14:35 am »
I use a TPlaysound to play a wav. Works fine.
Usually I have my Windows set to 5% sound intensity during the day.
This very Lazarus program (an alert) would be not heard at 5% at all.

How can I make the Lazarus item play louder, -  without changing the general setting of Windows?
Windows has an individual setting for every software, but it does not keep it after restart. And it takes an eternity to find.

So it would be great to have some lines of code, which will change this by code e.g. on the create-event of my program.

Thanks in advance,
Nicole

Zvoni

  • Hero Member
  • *****
  • Posts: 2741
Re: play sound - loud ! - but only individually
« Reply #1 on: July 08, 2022, 10:52:08 am »
Found something: https://www.nirsoft.net/utils/app_audio_config.html
Quote
Starting from Windows Vista, you are allowed to change the sound volume of every application separately, and after you exit from the application, the last settings are saved in the Registry under HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore so in the next time you run the application, your last settings are used.

For my VLC-Player it looks like this: Computer\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore\99cb5fd0_0
No Idea how the "99cb5fd0_0" is determined
That Key has a SubKey made from a GUID
In that SubKey there are three Values:
"3", "4", "5"
Playing around, i could find out, that "3" corresponds with the Volume-Setting, while "5" is Mute/Unmute
"4" is probably Left/Right
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1315
Re: play sound - loud ! - but only individually
« Reply #2 on: July 08, 2022, 12:08:43 pm »
This is the API you need. But I couldn't find a declaration of the ISimpleAudioVolume interface (from audioclient.h) in de fpc sources.

Nicole

  • Hero Member
  • *****
  • Posts: 1009
Re: play sound - loud ! - but only individually
« Reply #3 on: July 08, 2022, 02:05:37 pm »
Thank you for the answers.
What I would need: How to do this by Lazarus?
Do you have some lines of code for me?

Zvoni

  • Hero Member
  • *****
  • Posts: 2741
« Last Edit: July 08, 2022, 02:55:24 pm by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018