comparison collector/volume_osx.py @ 4:5ad799e534a5

move to subdir
author drewp@bigasterisk.com
date Mon, 13 Mar 2023 18:50:23 -0700
parents volume_osx.py@04c8a1b3976b
children
comparison
equal deleted inserted replaced
3:3d7fc94a404a 4:5ad799e534a5
1 from osascript import osascript
2
3
4 async def get_volume():
5 out = osascript('output volume of (get volume settings)')
6 return int(out[1]) / 100
7
8
9 async def set_volume(v: float):
10 i = round(v * 100)
11 osascript(f"set volume output volume {i}")