diff --git a/index.js b/index.js index 12eca95..68c4de0 100644 --- a/index.js +++ b/index.js @@ -115,6 +115,14 @@ const voicemeeter = { throw "Logout failed"; }, + getOutputDeviceNumber() { + return libvoicemeeter.VBVMR_Output_GetDeviceNumber(); + }, + + getInputDeviceNumber() { + return libvoicemeeter.VBVMR_Input_GetDeviceNumber(); + }, + updateDeviceList() { if (!this.isConnected) @@ -123,7 +131,7 @@ const voicemeeter = { this.outputDevices = []; this.inputDevices = []; - const outputDeviceNumber = libvoicemeeter.VBVMR_Output_GetDeviceNumber(); + const outputDeviceNumber = this.getOutputDeviceNumber(); for (let i = 0; i < outputDeviceNumber; i++) { const hardwareIdPtr = new CharArray(256); @@ -138,7 +146,7 @@ const voicemeeter = { }); } - const inputDeviceNumber = libvoicemeeter.VBVMR_Input_GetDeviceNumber(); + const inputDeviceNumber = this.getInputDeviceNumber(); for (let i = 0; i < inputDeviceNumber; i++) { const hardwareIdPtr = new CharArray(256); diff --git a/package.json b/package.json index 6ee9bc5..e8549e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "voicemeeter-remote", - "version": "0.2.0", + "version": "0.3.1", "description": "A Node.js voicemeeter remote wrapper", "main": "index.js", "author": "Mickael MAYEUR",