add new levels example

This commit is contained in:
onyx-and-iris 2023-06-23 17:54:08 +01:00
parent 27d7f1fcd5
commit 0548d82295
2 changed files with 41 additions and 0 deletions

13
examples/levels/README.md Normal file
View File

@ -0,0 +1,13 @@
## About
The purpose of this script is to demonstrate:
- use of the interface without a context manager.
- retrieving level values for channels by polling (instead of receiving data as event)
- use of the interface without the events thread running.
## Use
Configured for potato version.
Make sure you are playing audio into the first virtual strip and out of the first physical bus, both channels are unmuted and that you aren't monitoring another mixbus. Then run the script.

View File

@ -0,0 +1,28 @@
import logging
import time
import voicemeeterlib
logging.basicConfig(level=logging.INFO)
def main():
KIND_ID = "potato"
vm = voicemeeterlib.api(KIND_ID)
vm.login()
for _ in range(500):
print(
"\n".join(
[
f"{vm.strip[5]}: {vm.strip[5].levels.postmute}",
f"{vm.bus[1]}: {vm.bus[0].levels.all}",
]
)
)
time.sleep(0.033)
vm.logout()
if __name__ == "__main__":
main()