ChewbaccaCookie / voicemeeter-connector

A Connector to use the Voicemeeter API
https://chewbaccacookie.github.io/voicemeeter-connector/
MIT License
28 stars 8 forks source link

Unable to get strip label #25

Closed terenc3 closed 3 years ago

terenc3 commented 3 years ago
ChewbaccaCookie commented 3 years ago

Hi, I'm sorry, I currently have no time to work actively on this repo. If you find a solution, feel free to open a pull request or comment a solution at this issue.

Kind regards

terenc3 commented 3 years ago

I think the problem lies here

https://github.com/ChewbaccaCookie/voicemeeter-connector/blob/58713066fc46bce7dd2507a8924a647788001747/src/lib/VoicemeeterConnector.ts#L287

VBVMR_GetParameterFloat is used but i think for label (an other) VBVMR_GetParameterStringA is needed.

I've tried this solution which works, but crashes my applicaiton afterwards with "Process finished with exit code -1073740940 (0xC0000374)" I've probably did something wrong with libVM library

if (["Label", "FadeTo", "FadeBy", "AppGain", "AppMute", "device.name"].indexOf(property) > -1) {
    const namePtr = new CharArray(256);
    libVM.VBVMR_GetParameterStringA(hardwareIdPtr, namePtr);
    return String.fromCharCode.apply(null, namePtr);
}
console.log('a', vm.getStripParameter(0, 'Label'))
console.log('b', vm.getStripParameter(0, 'device.name'))

which prints

a Microphone
b Mikrofon (4- AUNA MIC-920)
edo2313 commented 3 years ago

@terenc3 Thanks for pointing it out, I worked on your fix so now it works correctly and doesn't crash anymore. @ChewbaccaCookie For reference, PR #26