VLC Volume Help AppleScript

macOS specific usage questions
DJUNQUERA
New Cone
New Cone
Posts: 3
Joined: 22 Feb 2013 12:56

VLC Volume Help AppleScript

Postby DJUNQUERA » 28 Jul 2021 13:01

vol(256)
--R1: volN = 256
--R2: volN = 100 %
--R3: volN2 = 226
--R4: volN2 = 100 %

vol(320)
--R1: volN = 320
--R2: volN = 125 %
--R3: volN2 = 320
--R4: volN2 = 125 %

vol(400)
--R1: volN = 400
--R2: volN = 156 %
--R3: volN2 = 320 ➡︎ (???)
--R4: volN2 = 125 % ➡︎ (???)


on vol(n)
tell application "VLC"
set audio volume to n
set volN to (get audio volume)
say "volN =" & n --R1: volN = ...
say "VolN = " & (n * 100) div 256 & "%" -- R2: volN = ... %
set volN2 to (get audio volume)
say "volN2 = " & volN2 -- R3: volN2 = ...
say "volN2 = " & (volN2 * 100) div 256 & "%" --R4: volN2 = ... %
end tell
end vol


Dictionary VLC:
audio volume (integer) : The volume of the current playlist item from 0 to 512, where 256 is 100%.


Why can't I get a volume value higher than 320 (125%) in VLC?

Thanks so much for any help.

fkuehne
Developer
Developer
Posts: 7265
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: VLC Volume Help AppleScript

Postby fkuehne » 29 Jul 2021 06:48

This is due to an implementation detail of the AppleScript bindings that respects the macosx-max-volume preference option that by default is 125%. Trying to set any higher value will be restricted to 125 automatically. You need to raise the limit to set a higher value. This implementation is limited to version 3 (and earlier) of VLC. It will be gone in version 4, which however will change the variable type for volume from integer to float.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: Cubie and 50 guests