diff --git a/examples/levels/README.md b/examples/levels/README.md new file mode 100644 index 0000000..a4c7a33 --- /dev/null +++ b/examples/levels/README.md @@ -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. diff --git a/examples/levels/__main__.py b/examples/levels/__main__.py new file mode 100644 index 0000000..fd5f907 --- /dev/null +++ b/examples/levels/__main__.py @@ -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()