Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] GetInputAudioTracks() always returns false for all properties #142

Open
testphpproject01 opened this issue Jul 28, 2024 · 0 comments

Comments

@testphpproject01
Copy link

testphpproject01 commented Jul 28, 2024

Issue Type

  • Bug

Describe the bug
GetInputAudioTracks() always returns false for all properties

To Reproduce
Steps to reproduce the behavior:

  1. To configure Input Audio Tracks into OBS. (Example: 1 track is active and other is inactive)
  2. in the program, call
    var tracks = obs.GetInputAudioTracks(inputName);
    var o = JObject.FromObject(tracks);
    Console.WriteLine(o);
  3. See error, all property is false
    {
    "track1": false,
    "track2": false,
    "track3": false,
    "track4": false,
    "track5": false,
    "track6": false
    }

Expected behavior
Return to the real state of the settings Input Audio Tracks. For our example
{
"track1": true,
"track2": false,
"track3": false,
"track4": false,
"track5": false,
"track6": false
}

Screenshots
If applicable, add screenshots to help explain your problem.

Versions
OBS Version: 30.2.2 (64-bit)
OBS WebSocket Version:
OBS WebSocket Dotnet (this library) Version: 5.0.0.3
OS: Windows 11

Additional context
The library is waiting for a response from OBS as:
{
"track1": true,
"track2": false,
"track3": false,
"track4": false,
"track5": false,
"track6": false
}
See in source obs-websocket-dotnet-5.0.0.3\obs-websocket-dotnet\Types\SourceTracks.cs

But realy response from OBS is:
{
"inputAudioTracks": {
"1": true,
"2": false,
"3": false,
"4": false,
"5": false,
"6": false
}
}
It needs to be fixed deserialize SourceTracks.
[JsonProperty(PropertyName = "track1")]
need as
[JsonProperty(PropertyName = "1")]

And
public SourceTracks(JObject data)
{
JsonConvert.PopulateObject(data.ToString(), this);
}
need as
public SourceTracks(JObject data)
{
JsonConvert.PopulateObject(data["inputAudioTracks"].ToString(), this);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant