Skip to content

When trying to use the API 2 times in a row, an error occurs: voicemeeter.errors.VMRDriverError: VMR#VBVMR_Login() returned -2 #18

@portg80

Description

@portg80

For example, this code:

import time

import voicemeeter

# Can be 'basic', 'banana' or 'potato'
kind = 'potato'
# Ensure that Voicemeeter is launched
voicemeeter.launch(kind)

#action 1
with voicemeeter.remote(kind) as vmr:
  # Set the mapping of the second input strip
  vmr.inputs[1].A4 = True
  print(f'Output A4 of Strip {vmr.inputs[1].label}: {vmr.inputs[1].A4}')

time.sleep(10)

#action 2
with voicemeeter.remote(kind) as vmr:
  # Set the mapping of the second input strip
  vmr.inputs[1].A4 = False
  print(f'Output A4 of Strip {vmr.inputs[1].label}: {vmr.inputs[1].A4}')
  

It's as if the first call doesn't release the dll. I also tried using Logout, without with, as the first action is triggered, and the second gives an error.

I wanted to integrate this with my voice assistant, but even if the commands are called after a while, the error occurs the second time.
If you run the python script with action 1 and then close it, change it to action 2 and run it, then everything works, but in my case restarting the python script is not an option.
What's the matter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions