mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2024-11-16 00:40:46 +00:00
add new levels example
This commit is contained in:
parent
27d7f1fcd5
commit
0548d82295
13
examples/levels/README.md
Normal file
13
examples/levels/README.md
Normal 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.
|
28
examples/levels/__main__.py
Normal file
28
examples/levels/__main__.py
Normal 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()
|
Loading…
Reference in New Issue
Block a user