Git Product home page Git Product logo

voicemeeter-api-python's People

Contributors

dependabot[bot] avatar onyx-and-iris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zadli ty1135

voicemeeter-api-python's Issues

bounds checks: log warnings instead of raising errors

example in vban class:

    @sr.setter
    def sr(self, val: int):
        opts = (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
        if val not in opts:
            raise VMError(f"Expected one of: {opts}")

we might instead:

    @sr.setter
    def sr(self, val: int):
        opts = (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
        if val not in opts:
            self.logger.warning(f"sr got {val} but expected a value in {opts}")

it might be better for us to simply log these occurrences as warnings for the following reasons:

  • it's documented in the README which values are expected
  • I don't think passing a value out of bounds is severe enough to raise an Error.
  • the C-API will silently ignore unexpected values so it won't cause an issue at a lower level.

Example Usage Not Using `with` Statement

First of all, this is AWESOME! I can't wait to start using this project. I've been wanting to create a little web-interface so that I could interact with VoiceMeeter on a remote server, maybe even integrate with Home Assistant. I think I'll want to use this project to give that system some legs to stand on. So kudos to you on this awesome project, and THANK YOU! I can't wait to get started.

I wanted to ask, though, do you have a recommended example for using the API outside the support of a with statement? Since I'm interested in using this with FastAPI as the web-server-backend, it would likely make the most sense to have a global VoiceMeeter context, or at least one per web-session, not spinning them up for every single request - which would seem excessive.
Looking at the __enter__ and __exit__ blocks, the pattern below seems to make the most sense. Do you have other suggestions?

# Base Framework Example

import voicemeeterlib
from fastapi import FastAPI

KIND = "banana"

app = FastAPI()

vm_api = voicemeeterlib.api(KIND)
vm_api.login()
vm_api.init_thread()

...

# Closing Down
#vm_api.end_thread()
#vm_api.logout()

Is this a reasonable approach, or would you recommend another syntax form? Thank you, again!

关于API数据更新延迟

你好,我遇到一个问题。

在potato程序上划动音量增益推子修改数值后,使用py获取该数值。
import voicemeeterlib

KIND_ID = "potato"
with voicemeeterlib.api(KIND_ID) as vm:
print(vm.strip[3].gain)

但第一次获取的数值不是potato程序当前的数值,需要第二次重新运行py才能获取到potato程序当前的数值!
应该怎么解决呢?提前感谢作者

Login can raise a CAPIError if the API takes too long to respond.

I've noticed that sometimes it's taking a bit longer than 1 second for the API to respond after a login (if it needs to start the audio engine first). This can cause {Remote}.login() to raise a CAPIError when in fact waiting a bit longer for a response succeeds.

Setting a timeout for login should fix this.

AttributeError: function 'VBVMR_MacroButton_IsDirty' not found

Traceback (most recent call last):
  File "C:\Users\user\Documents\pythonProject\test208.py", line 1, in <module>
    import voicemeeterlib
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\voicemeeterlib\__init__.py", line 1, in <module>
    from .factory import request_remote_obj as api
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\voicemeeterlib\factory.py", line 16, in <module>
    from .remote import Remote
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\voicemeeterlib\remote.py", line 8, in <module>
    from .cbindings import CBindings
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\voicemeeterlib\cbindings.py", line 9, in <module>
    class CBindings(metaclass=ABCMeta):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\voicemeeterlib\cbindings.py", line 36, in CBindings
    vm_mdirty = libc.VBVMR_MacroButton_IsDirty
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'VBVMR_MacroButton_IsDirty' not found

Implement new comp, gate parameters. (potato version)

This will mean introducing a breaking change, so a new major version will be required.

Also would be worth adding a mixin class for Denoiser (I think Voicemeeter devs intend to add more parameters for denoiser in future version of api)

Make autostart of VM configurable

Hey,

On my system the script starts VM on itself which is not desired.

please add an option to disable the autostart of VM to voicemeeterlib.api().

and, at least on my system, the startet VM version is 32bit... wich is kinda odd. ;)
so maybe a "32bit bool" might also be recommended - for 64bit by default.

like this:

voicemeeterlib.api(KIND_ID, autostart: bool = True, 32bit: bool = False)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.